本文整理匯總了Java中android.view.KeyEvent.KEYCODE_O屬性的典型用法代碼示例。如果您正苦於以下問題:Java KeyEvent.KEYCODE_O屬性的具體用法?Java KeyEvent.KEYCODE_O怎麽用?Java KeyEvent.KEYCODE_O使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.view.KeyEvent
的用法示例。
在下文中一共展示了KeyEvent.KEYCODE_O屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onKeyShortcut
@Override
public boolean onKeyShortcut(int keyCode, KeyEvent event) {
if (event.hasModifiers(KeyEvent.META_CTRL_ON)) {
switch (keyCode) {
case KeyEvent.KEYCODE_A:
if (mState == State.WORKSPACE) {
showAppsView(true, false);
return true;
}
break;
case KeyEvent.KEYCODE_S: {
View focusedView = getCurrentFocus();
if (focusedView instanceof BubbleTextView
&& focusedView.getTag() instanceof ItemInfo
&& mAccessibilityDelegate.performAction(focusedView,
(ItemInfo) focusedView.getTag(),
LauncherAccessibilityDelegate.DEEP_SHORTCUTS)) {
PopupContainerWithArrow.getOpen(this).requestFocus();
return true;
}
break;
}
case KeyEvent.KEYCODE_O:
if (new CustomActionsPopup(this, getCurrentFocus()).show()) {
return true;
}
break;
}
}
return super.onKeyShortcut(keyCode, event);
}
示例2: onKeyDown
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_R:
mViewModel.addRectLayer();
return true;
case KeyEvent.KEYCODE_T:
mViewModel.addTriangleLayer();
return true;
case KeyEvent.KEYCODE_O:
mViewModel.addOvalLayer();
return true;
}
if (mBinding.documentView.hasFocus()) {
switch (keyCode) {
case KeyEvent.KEYCODE_DEL:
case KeyEvent.KEYCODE_FORWARD_DEL:
return onContextMenuAction(DELETE);
}
if (event.isCtrlPressed()) {
switch (keyCode) {
case KeyEvent.KEYCODE_X:
return onContextMenuAction(CUT);
case KeyEvent.KEYCODE_C:
return onContextMenuAction(COPY);
case KeyEvent.KEYCODE_V:
return onContextMenuAction(PASTE);
case KeyEvent.KEYCODE_D:
return onContextMenuAction(DUPLICATE);
case KeyEvent.KEYCODE_G:
return onContextMenuAction(GROUP);
}
}
}
return super.onKeyDown(keyCode, event);
}