@Override public boolean dispatchKeyEvent(KeyEvent event) { // If the event was not handled then see if the player view can handle it. return super.dispatchKeyEvent(event) || playerManager.dispatchKeyEvent(event); }
@Override public boolean dispatchKeyEvent(KeyEvent event) { if (event.getAction() == KeyEvent.ACTION_UP && event.getKeyCode() == KeyEvent.KEYCODE_BACK && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { KPSwitchConflictUtil.hidePanelAndKeyboard(mPanelRoot); return true; } return super.dispatchKeyEvent(event); }
@Override public boolean dispatchKeyEvent(KeyEvent event) { if (event.getAction() == KeyEvent.ACTION_UP && event.getKeyCode() == KeyEvent.KEYCODE_BACK && mPanelRoot.getVisibility() == View.VISIBLE) { mPanelRoot.setVisibility(View.GONE); return true; } return super.dispatchKeyEvent(event); } }
@Override public boolean dispatchKeyEvent(KeyEvent event) { if (event.getAction() == KeyEvent.ACTION_UP && event.getKeyCode() == KeyEvent.KEYCODE_BACK && panelRoot.getVisibility() != View.GONE) { KPSwitchConflictUtil.hidePanelAndKeyboard(panelRoot); return true; } return super.dispatchKeyEvent(event); }
@Override public boolean dispatchKeyEvent(KeyEvent event) { if (event.getKeyCode() == KeyEvent.KEYCODE_DPAD_CENTER) { mHandler.removeMessages(MSG_CLEAN); mHandler.sendEmptyMessageDelayed(MSG_CLEAN, 500); } return super.dispatchKeyEvent(event); }
@Override public boolean dispatchKeyEvent(KeyEvent event) { if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) { KeyboardUtils.hideSoftInput(this); return true; } return super.dispatchKeyEvent(event); }
/** * Makes sure regular key events from anywhere in the activity are sent to the input field, * and giving it focus if it doesn't currently have focus. * * <p>Always asks the activity first, to make sure special keys are handled correctly, like the back button.</p> * * {@inheritDoc} */ @Override public boolean dispatchKeyEvent(final KeyEvent event) { if (super.dispatchKeyEvent(event)) { return true; } if (!privateChatInput.hasFocus()) { privateChatInput.requestFocus(); } return privateChatInput.dispatchKeyEvent(event); }
/** * Makes sure regular key events from anywhere in the activity are sent to the input field, * and giving it focus if it doesn't currently have focus. * * <p>Always asks the activity first, to make sure special keys are handled correctly, like the back button.</p> * * {@inheritDoc} */ @Override public boolean dispatchKeyEvent(final KeyEvent event) { if (super.dispatchKeyEvent(event)) { return true; } if (!mainChatInput.hasFocus()) { mainChatInput.requestFocus(); } return mainChatInput.dispatchKeyEvent(event); }
@Override public boolean dispatchKeyEvent(KeyEvent event) { if (mMenuVisible) { return super.dispatchKeyEvent(event); } int action; switch (event.getAction()) { case KeyEvent.ACTION_DOWN: // Handling the case where the back button is pressed. if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) { onBackPressed(); return true; } // Normal key events. action = NativeLibrary.ButtonState.PRESSED; break; case KeyEvent.ACTION_UP: action = NativeLibrary.ButtonState.RELEASED; break; default: return false; } InputDevice input = event.getDevice(); return NativeLibrary.onGamePadEvent(input.getDescriptor(), event.getKeyCode(), action); }
@Override public boolean dispatchKeyEvent(@NonNull KeyEvent event) { if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) { if (event.getAction() == KeyEvent.ACTION_UP) { if (mIsMultiChoiceModeEnabled) { setMultiChoiceModeEnabled(false); setupOkButtonVisibility(); } else { if (isTopDirectory(mCurrentDirectory)) { finish(); } else { readUpDirectory(); } } } else if (event.getAction() == KeyEvent.ACTION_DOWN && (event.getFlags() & KeyEvent.FLAG_LONG_PRESS) == KeyEvent.FLAG_LONG_PRESS) { finish(); } return true; } return super.dispatchKeyEvent(event); }