@Override public boolean dispatchGenericMotionEvent(MotionEvent event) { // Check that the event came from a joystick since a generic motion event // could be almost anything. if (event.isFromSource(InputDevice.SOURCE_CLASS_JOYSTICK) && event.getAction() == MotionEvent.ACTION_MOVE) { // Update device state for visualization and logging. InputDeviceState state = getInputDeviceState(event.getDeviceId()); if (state != null && state.onJoystickMotion(event)) { mSummaryAdapter.show(state); } } return super.dispatchGenericMotionEvent(event); }
@Override public boolean dispatchGenericMotionEvent(MotionEvent event) { // Check that the event came from a joystick since a generic motion event // could be almost anything. if (event.isFromSource(InputDevice.SOURCE_CLASS_JOYSTICK) && event.getAction() == MotionEvent.ACTION_MOVE) { // Update device state for visualization and logging. InputDeviceState state = getInputDeviceState(event.getDeviceId()); if (state != null && state.onJoystickMotion(event)) { mSummaryAdapter.show(state); } } return super.dispatchGenericMotionEvent(event); }
@Override public boolean dispatchKeyEvent(KeyEvent event) { // Update device state for visualization and logging. InputDeviceState state = getInputDeviceState(event.getDeviceId()); if (state != null) { switch (event.getAction()) { case KeyEvent.ACTION_DOWN: if (state.onKeyDown(event)) { mSummaryAdapter.show(state); } break; case KeyEvent.ACTION_UP: if (state.onKeyUp(event)) { mSummaryAdapter.show(state); } break; } } return super.dispatchKeyEvent(event); }
@Override public boolean dispatchKeyEvent(KeyEvent event) { // Update device state for visualization and logging. InputDeviceState state = getInputDeviceState(event.getDeviceId()); if (state != null) { switch (event.getAction()) { case KeyEvent.ACTION_DOWN: if (state.onKeyDown(event)) { mSummaryAdapter.show(state); } break; case KeyEvent.ACTION_UP: if (state.onKeyUp(event)) { mSummaryAdapter.show(state); } break; } } return super.dispatchKeyEvent(event); }