Last active
May 8, 2016 17:51
-
-
Save ShaunPlummer/ae2f9195d82ad9934fd9ec42f8c3406c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean onKeyDown(int keyCode, KeyEvent event) { | |
Log.d(LOG_TAG, "onKeyDown Keycode: " + keyCode); | |
switch (keyCode) { | |
case KeyEvent.KEYCODE_NAVIGATE_NEXT: | |
// Next gesture - wrist flick up quickly with slow down | |
mTextView.setText("Next"); | |
return true; | |
case KeyEvent.KEYCODE_NAVIGATE_PREVIOUS: | |
// Previous gesture - wrist flick down quickly with slow up | |
mTextView.setText("Previous"); | |
return true; | |
case KeyEvent.KEYCODE_NAVIGATE_IN: | |
//fist down | |
mTextView.setText("In"); | |
return true; | |
case KeyEvent.KEYCODE_NAVIGATE_OUT: | |
//fist up | |
mTextView.setText("Out"); | |
return true; | |
default: | |
//If the event was not consumed here pass it to super | |
return super.onKeyDown(keyCode, event); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment