Index: tools/dom/src/KeyCode.dart |
diff --git a/tools/dom/src/KeyCode.dart b/tools/dom/src/KeyCode.dart |
index 3fa6b7ce559de2d5f0d95e026fd9b3374f4299d4..e9dca604e739320a31d34c1b919751fac7c88e8d 100644 |
--- a/tools/dom/src/KeyCode.dart |
+++ b/tools/dom/src/KeyCode.dart |
@@ -216,13 +216,24 @@ abstract class KeyCode { |
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 || |
+ 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); |
} |
@@ -234,49 +245,86 @@ abstract class KeyCode { |
* follow the DOM3 spec. |
*/ |
static String _convertKeyCodeToKeyName(int keyCode) { |
- switch(keyCode) { |
- case KeyCode.ALT: return _KeyName.ALT; |
- case KeyCode.BACKSPACE: return _KeyName.BACKSPACE; |
- case KeyCode.CAPS_LOCK: return _KeyName.CAPS_LOCK; |
- case KeyCode.CTRL: return _KeyName.CONTROL; |
- case KeyCode.DELETE: return _KeyName.DEL; |
- case KeyCode.DOWN: return _KeyName.DOWN; |
- case KeyCode.END: return _KeyName.END; |
- case KeyCode.ENTER: return _KeyName.ENTER; |
- case KeyCode.ESC: return _KeyName.ESC; |
- case KeyCode.F1: return _KeyName.F1; |
- case KeyCode.F2: return _KeyName.F2; |
- case KeyCode.F3: return _KeyName.F3; |
- case KeyCode.F4: return _KeyName.F4; |
- case KeyCode.F5: return _KeyName.F5; |
- case KeyCode.F6: return _KeyName.F6; |
- case KeyCode.F7: return _KeyName.F7; |
- case KeyCode.F8: return _KeyName.F8; |
- case KeyCode.F9: return _KeyName.F9; |
- case KeyCode.F10: return _KeyName.F10; |
- case KeyCode.F11: return _KeyName.F11; |
- case KeyCode.F12: return _KeyName.F12; |
- case KeyCode.HOME: return _KeyName.HOME; |
- case KeyCode.INSERT: return _KeyName.INSERT; |
- case KeyCode.LEFT: return _KeyName.LEFT; |
- case KeyCode.META: return _KeyName.META; |
- case KeyCode.NUMLOCK: return _KeyName.NUM_LOCK; |
- case KeyCode.PAGE_DOWN: return _KeyName.PAGE_DOWN; |
- case KeyCode.PAGE_UP: return _KeyName.PAGE_UP; |
- case KeyCode.PAUSE: return _KeyName.PAUSE; |
- case KeyCode.PRINT_SCREEN: return _KeyName.PRINT_SCREEN; |
- case KeyCode.RIGHT: return _KeyName.RIGHT; |
- case KeyCode.SCROLL_LOCK: return _KeyName.SCROLL; |
- case KeyCode.SHIFT: return _KeyName.SHIFT; |
- case KeyCode.SPACE: return _KeyName.SPACEBAR; |
- case KeyCode.TAB: return _KeyName.TAB; |
- case KeyCode.UP: return _KeyName.UP; |
+ switch (keyCode) { |
+ case KeyCode.ALT: |
+ return _KeyName.ALT; |
+ case KeyCode.BACKSPACE: |
+ return _KeyName.BACKSPACE; |
+ case KeyCode.CAPS_LOCK: |
+ return _KeyName.CAPS_LOCK; |
+ case KeyCode.CTRL: |
+ return _KeyName.CONTROL; |
+ case KeyCode.DELETE: |
+ return _KeyName.DEL; |
+ case KeyCode.DOWN: |
+ return _KeyName.DOWN; |
+ case KeyCode.END: |
+ return _KeyName.END; |
+ case KeyCode.ENTER: |
+ return _KeyName.ENTER; |
+ case KeyCode.ESC: |
+ return _KeyName.ESC; |
+ case KeyCode.F1: |
+ return _KeyName.F1; |
+ case KeyCode.F2: |
+ return _KeyName.F2; |
+ case KeyCode.F3: |
+ return _KeyName.F3; |
+ case KeyCode.F4: |
+ return _KeyName.F4; |
+ case KeyCode.F5: |
+ return _KeyName.F5; |
+ case KeyCode.F6: |
+ return _KeyName.F6; |
+ case KeyCode.F7: |
+ return _KeyName.F7; |
+ case KeyCode.F8: |
+ return _KeyName.F8; |
+ case KeyCode.F9: |
+ return _KeyName.F9; |
+ case KeyCode.F10: |
+ return _KeyName.F10; |
+ case KeyCode.F11: |
+ return _KeyName.F11; |
+ case KeyCode.F12: |
+ return _KeyName.F12; |
+ case KeyCode.HOME: |
+ return _KeyName.HOME; |
+ case KeyCode.INSERT: |
+ return _KeyName.INSERT; |
+ case KeyCode.LEFT: |
+ return _KeyName.LEFT; |
+ case KeyCode.META: |
+ return _KeyName.META; |
+ case KeyCode.NUMLOCK: |
+ return _KeyName.NUM_LOCK; |
+ case KeyCode.PAGE_DOWN: |
+ return _KeyName.PAGE_DOWN; |
+ case KeyCode.PAGE_UP: |
+ return _KeyName.PAGE_UP; |
+ case KeyCode.PAUSE: |
+ return _KeyName.PAUSE; |
+ case KeyCode.PRINT_SCREEN: |
+ return _KeyName.PRINT_SCREEN; |
+ case KeyCode.RIGHT: |
+ return _KeyName.RIGHT; |
+ case KeyCode.SCROLL_LOCK: |
+ return _KeyName.SCROLL; |
+ case KeyCode.SHIFT: |
+ return _KeyName.SHIFT; |
+ case KeyCode.SPACE: |
+ return _KeyName.SPACEBAR; |
+ case KeyCode.TAB: |
+ return _KeyName.TAB; |
+ case KeyCode.UP: |
+ return _KeyName.UP; |
case KeyCode.WIN_IME: |
case KeyCode.WIN_KEY: |
case KeyCode.WIN_KEY_LEFT: |
case KeyCode.WIN_KEY_RIGHT: |
return _KeyName.WIN; |
- default: return _KeyName.UNIDENTIFIED; |
+ default: |
+ return _KeyName.UNIDENTIFIED; |
} |
return _KeyName.UNIDENTIFIED; |
} |