當前位置: 首頁>>代碼示例>>Java>>正文


Java KeyEvent.KEYCODE_I屬性代碼示例

本文整理匯總了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);
}
 
開發者ID:archos-sa,項目名稱:aos-Video,代碼行數:25,代碼來源:PlayerActivity.java

示例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);
    }
}
 
開發者ID:StylingAndroid,項目名稱:PresenterLite,代碼行數:23,代碼來源:StandaloneDisplayActivity.java


注:本文中的android.view.KeyEvent.KEYCODE_I屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。