本文整理汇总了Java中android.view.KeyEvent.KEYCODE_I属性的典型用法代码示例。如果您正苦于以下问题:Java KeyEvent.KEYCODE_I属性的具体用法?Java KeyEvent.KEYCODE_I怎么用?Java KeyEvent.KEYCODE_I使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.view.KeyEvent
的用法示例。
在下文中一共展示了KeyEvent.KEYCODE_I属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onKeyDown
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
boolean handled = false;
// When using DPad, show all the OSD so that focus can move freely
// from/to ActionBar to/from PlayerController
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_UP:
if(mPlayerController!=null){
return mPlayerController.onKey(keyCode, event);
}
break;
case KeyEvent.KEYCODE_I:
showVideoInfos();
handled = true;
break;
}
if (!mStopped && (mPlayerController!=null) &&mPlayerControllerPlaceholder!=null&&!handled) {
// Send key event to PlayerController if it (its place-holder actually) has the focus
// Only keep keys used for focus navigation (because this is not handled by PlayerController)
handled = mPlayerController.onKey(keyCode, event);
}
return handled ? true : super.onKeyDown(keyCode, event);
}
示例2: onKeyUp
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
Log.d("KEYS", event.toString());
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_LEFT:
case KeyEvent.KEYCODE_PAGE_UP:
previous();
return true;
case KeyEvent.KEYCODE_SPACE:
case KeyEvent.KEYCODE_DPAD_RIGHT:
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_PAGE_DOWN:
advance();
return true;
case KeyEvent.KEYCODE_I:
case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
case KeyEvent.KEYCODE_PERIOD:
display();
return true;
default:
return super.onKeyUp(keyCode, event);
}
}