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


Java KeyEvent.KEYCODE_R屬性代碼示例

本文整理匯總了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);
}
 
開發者ID:victordiaz,項目名稱:phonk,代碼行數:20,代碼來源:EditorActivity.java

示例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;
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:19,代碼來源:DoubleTapReloadRecognizer.java

示例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);

}
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:31,代碼來源:UndoRedoSupportEditText.java

示例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);
}
 
開發者ID:google,項目名稱:spline,代碼行數:40,代碼來源:EditorActivity.java

示例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);
}
 
開發者ID:victordiaz,項目名稱:phonk,代碼行數:11,代碼來源:AppRunnerActivity.java


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