android.view.KeyEvent.metaStateHasNoModifiers()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中android.view.KeyEvent.metaStateHasNoModifiers()方法的一些代码示例,展示了KeyEvent.metaStateHasNoModifiers()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyEvent.metaStateHasNoModifiers()方法的具体详情如下:
包路径:android.view.KeyEvent
类名称:KeyEvent
方法名:metaStateHasNoModifiers

KeyEvent.metaStateHasNoModifiers介绍

暂无

代码示例

代码示例来源:origin: seven332/EhViewer

@Override
protected boolean handleMovementKey(TextView widget, Spannable buffer, int keyCode,
    int movementMetaState, KeyEvent event) {
  switch (keyCode) {
    case KeyEvent.KEYCODE_DPAD_CENTER:
    case KeyEvent.KEYCODE_ENTER:
      if (KeyEvent.metaStateHasNoModifiers(movementMetaState)) {
        if (event.getAction() == KeyEvent.ACTION_DOWN &&
            event.getRepeatCount() == 0 && action(CLICK, widget, buffer)) {
          return true;
        }
      }
      break;
  }
  return super.handleMovementKey(widget, buffer, keyCode, movementMetaState, event);
}

代码示例来源:origin: FolioReader/FolioReader-Android

if (KeyEvent.metaStateHasNoModifiers(event.getMetaState())) {
  handled = arrowScroll(FOCUS_FORWARD);
} else if (KeyEvent.metaStateHasNoModifiers(event.getMetaState())) {
  handled = arrowScroll(FOCUS_BACKWARD);

代码示例来源:origin: com.google.android/support-v4

public static boolean metaStateHasNoModifiers(int metaState) {
    return KeyEvent.metaStateHasNoModifiers(metaState);
  }
}

代码示例来源:origin: kingargyle/adt-leanback-support

public static boolean metaStateHasNoModifiers(int metaState) {
    return KeyEvent.metaStateHasNoModifiers(metaState);
  }
}

代码示例来源:origin: andforce/iBeebo

@Override
protected boolean handleMovementKey(TextView widget, Spannable buffer, int keyCode, int movementMetaState, KeyEvent event) {
  switch (keyCode) {
    case KeyEvent.KEYCODE_DPAD_CENTER:
    case KeyEvent.KEYCODE_ENTER:
      if (KeyEvent.metaStateHasNoModifiers(movementMetaState)) {
        if (event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount() == 0
            && action(CLICK, widget, buffer)) {
          return true;
        }
      }
      break;
  }
  return super.handleMovementKey(widget, buffer, keyCode, movementMetaState, event);
}

代码示例来源:origin: zhe525069676/WeiBoLayout

@Override
protected boolean handleMovementKey(TextView widget, Spannable buffer, int keyCode,
                  int movementMetaState, KeyEvent event) {
  switch (keyCode) {
    case KeyEvent.KEYCODE_DPAD_CENTER:
    case KeyEvent.KEYCODE_ENTER:
      if (KeyEvent.metaStateHasNoModifiers(movementMetaState)) {
        if (event.getAction() == KeyEvent.ACTION_DOWN &&
            event.getRepeatCount() == 0 && action(CLICK, widget, buffer)) {
          return true;
        }
      }
      break;
  }
  return super.handleMovementKey(widget, buffer, keyCode, movementMetaState, event);
}

代码示例来源:origin: nekocode/JarFilterPlugin

/**
 * KeyEvents with non-default modifiers are not dispatched to menu's performShortcut in API 25
 * or lower. Here, we check if the keypress corresponds to a menuitem's shortcut combination
 * and perform the corresponding action.
 */
private boolean performMenuItemShortcut(int keycode, KeyEvent event) {
  if (!(Build.VERSION.SDK_INT >= 26) && !event.isCtrlPressed()
      && !KeyEvent.metaStateHasNoModifiers(event.getMetaState())
      && event.getRepeatCount() == 0
      && !KeyEvent.isModifierKey(event.getKeyCode())) {
    final Window currentWindow = getWindow();
    if (currentWindow != null && currentWindow.getDecorView() != null) {
      final View decorView = currentWindow.getDecorView();
      if (decorView.dispatchKeyShortcutEvent(event)) {
        return true;
      }
    }
  }
  return false;
}

相关文章