public boolean onGenericMotionEvent(MotionEvent event) { if ( (event.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) { //handle the event return true; } else { return false; } }