本文整理汇总了Java中android.view.KeyEvent.KEYCODE_BUTTON_THUMBR属性的典型用法代码示例。如果您正苦于以下问题:Java KeyEvent.KEYCODE_BUTTON_THUMBR属性的具体用法?Java KeyEvent.KEYCODE_BUTTON_THUMBR怎么用?Java KeyEvent.KEYCODE_BUTTON_THUMBR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.view.KeyEvent
的用法示例。
在下文中一共展示了KeyEvent.KEYCODE_BUTTON_THUMBR属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleShortcut
public boolean handleShortcut(GenericGamepad gamepad, int keyCode, boolean down) {
if (gamepad == null) return false;
boolean wasScreenshotComboDown = isL3down && isR3down;
if (getOriginCode(gamepad, keyCode) == KeyEvent.KEYCODE_BUTTON_THUMBL) isL3down = down;
if (getOriginCode(gamepad, keyCode) == KeyEvent.KEYCODE_BUTTON_THUMBR) isR3down = down;
if (!wasScreenshotComboDown) {
if (isL3down && isR3down) {
boolean handled = listener.handleShortcut(ShortCut.SCREENSHOT, down);
if (handled) return true;
}
}
if (isStartButton(gamepad, keyCode)) {
if (down) {
inShortcutSequence = true;
return true;
} else {
inShortcutSequence = false;
if (!wasShortcutSent) sendStartKeyPress(gamepad); // send pending Start if no shortcut was generated
wasShortcutSent = false;
return true;
}
}
if (inShortcutSequence) {
wasShortcutSent = handleDetectedShortcut(getOriginCode(gamepad, keyCode), down);
if (wasShortcutSent && !down) inShortcutSequence = false; // make sure that we clean this. Another window could receive the keyUp
return wasShortcutSent;
}
return false;
}