本文整理匯總了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);
}
}