예제 #1
0
  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    if ((keyCode == KeyEvent.KEYCODE_BACK) && (event.getRepeatCount() == 0)) {
      NativeKeydown(253); // Trigger KeyBack in ZGE
      if (NativeCloseQuery()) IsDestroy = true;
      return true;
    } else NativeKeydown(event.getUnicodeChar());

    return super.onKeyDown(keyCode, event);
  }
예제 #2
0
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
      switch (keyCode) {
        case KeyEvent.KEYCODE_VOLUME_UP:
        case KeyEvent.KEYCODE_VOLUME_DOWN:
          return super.onKeyDown(keyCode, event);

        default:
          break;
      }

      handleKeyDown(host, keyCode, event.getUnicodeChar());
      return true;
    }
예제 #3
0
  @Override
  public boolean sendKeyEvent(KeyEvent event) {

    /*
     * This handles the keycodes from soft keyboard (and IME-translated
     * input from hardkeyboard)
     */
    int keyCode = event.getKeyCode();
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
      if (event.isPrintingKey()) {
        commitText(String.valueOf((char) event.getUnicodeChar()), 1);
      }
      SDLActivity.onNativeKeyDown(keyCode);
      return true;
    } else if (event.getAction() == KeyEvent.ACTION_UP) {

      SDLActivity.onNativeKeyUp(keyCode);
      return true;
    }
    return super.sendKeyEvent(event);
  }
예제 #4
0
  @Override
  public boolean onKey(View v, int keyCode, KeyEvent event) {

    // This handles the hardware keyboard input
    if (event.isPrintingKey()) {
      if (event.getAction() == KeyEvent.ACTION_DOWN) {
        ic.commitText(String.valueOf((char) event.getUnicodeChar()), 1);
      }
      return true;
    }

    if (event.getAction() == KeyEvent.ACTION_DOWN) {
      SDLActivity.onNativeKeyDown(keyCode);
      return true;
    } else if (event.getAction() == KeyEvent.ACTION_UP) {
      SDLActivity.onNativeKeyUp(keyCode);
      return true;
    }

    return false;
  }
예제 #5
0
 @Override
 public boolean onKeyUp(int keyCode, KeyEvent event) {
   NativeKeyup(event.getUnicodeChar());
   return super.onKeyUp(keyCode, event);
 }
예제 #6
0
 @Override
 public boolean onKeyDown(int keyCode, KeyEvent event) {
   GodotLib.key(event.getUnicodeChar(0), true);
   return super.onKeyDown(keyCode, event);
 };
예제 #7
0
 @Override
 public boolean onKeyUp(int keyCode, KeyEvent event) {
   handleKeyUp(host, keyCode, event.getUnicodeChar());
   return true;
 }