本文整理汇总了Java中android.view.KeyEvent.KEYCODE_R属性的典型用法代码示例。如果您正苦于以下问题:Java KeyEvent.KEYCODE_R属性的具体用法?Java KeyEvent.KEYCODE_R怎么用?Java KeyEvent.KEYCODE_R使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.view.KeyEvent
的用法示例。
在下文中一共展示了KeyEvent.KEYCODE_R属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onKeyShortcut
@Override
public boolean onKeyShortcut(int keyCode, KeyEvent event) {
if (event.isCtrlPressed()) {
switch (keyCode) {
case KeyEvent.KEYCODE_R:
saveAndRun();
break;
case KeyEvent.KEYCODE_S:
save();
break;
case KeyEvent.KEYCODE_F:
toggleApiDrawer();
break;
}
}
return super.onKeyShortcut(keyCode, event);
}
示例2: didDoubleTapR
public boolean didDoubleTapR(int keyCode, View view) {
if (keyCode == KeyEvent.KEYCODE_R && !(view instanceof EditText)) {
if (mDoRefresh) {
mDoRefresh = false;
return true;
} else {
mDoRefresh = true;
new Handler().postDelayed(
new Runnable() {
@Override
public void run() {
mDoRefresh = false;
}
},
DOUBLE_TAP_DELAY);
}
}
return false;
}
示例3: onKeyUp
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (DLog.DEBUG) {
Log.w(TAG, "onKeyUp " + event);
}
if (handleControlKey(keyCode, event, false)) {
return true;
}
if (event.isCtrlPressed() || mKeyListener.mControlKey.isActive()) {
switch (keyCode) {
case KeyEvent.KEYCODE_A:
case KeyEvent.KEYCODE_X:
case KeyEvent.KEYCODE_C:
case KeyEvent.KEYCODE_V:
case KeyEvent.KEYCODE_Z:
case KeyEvent.KEYCODE_Y:
case KeyEvent.KEYCODE_S:
case KeyEvent.KEYCODE_R:
case KeyEvent.KEYCODE_F:
case KeyEvent.KEYCODE_L:
return true;
}
} else {
switch (keyCode) {
case KeyEvent.KEYCODE_TAB:
return true;
}
}
return super.onKeyUp(keyCode, event);
}
示例4: 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);
}
示例5: onKeyShortcut
@Override
public boolean onKeyShortcut(int keyCode, KeyEvent event) {
if (event.isCtrlPressed()) {
switch (keyCode) {
case KeyEvent.KEYCODE_R:
finish();
break;
}
}
return super.onKeyShortcut(keyCode, event);
}