Movatterモバイル変換


[0]ホーム

URL:


menu
  1. Dart
  2. dart:html
  3. KeyCode
  4. isCharacterKey static method
isCharacterKey
description

isCharacterKey static method

boolisCharacterKey(
  1. intkeyCode
)

Returns true if the keyCode produces a (US keyboard) character.Note: This does not (yet) cover characters on non-US keyboards (Russian,Hebrew, etc.).

Implementation

static bool isCharacterKey(int keyCode) {  if ((keyCode >= ZERO && keyCode <= NINE) ||      (keyCode >= NUM_ZERO && keyCode <= NUM_MULTIPLY) ||      (keyCode >= A && keyCode <= Z)) {    return true;  }  // Safari sends zero key code for non-latin characters.  if (Device.isWebKit && keyCode == 0) {    return true;  }  return (keyCode == SPACE ||      keyCode == QUESTION_MARK ||      keyCode == NUM_PLUS ||      keyCode == NUM_MINUS ||      keyCode == NUM_PERIOD ||      keyCode == NUM_DIVISION ||      keyCode == SEMICOLON ||      keyCode == FF_SEMICOLON ||      keyCode == DASH ||      keyCode == EQUALS ||      keyCode == FF_EQUALS ||      keyCode == COMMA ||      keyCode == PERIOD ||      keyCode == SLASH ||      keyCode == APOSTROPHE ||      keyCode == SINGLE_QUOTE ||      keyCode == OPEN_SQUARE_BRACKET ||      keyCode == BACKSLASH ||      keyCode == CLOSE_SQUARE_BRACKET);}
  1. Dart
  2. dart:html
  3. KeyCode
  4. isCharacterKey static method
KeyCode class

[8]ページ先頭

©2009-2025 Movatter.jp