keys.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. define("dojo/keys", ["./_base/kernel", "./_base/sniff"], function(dojo, has) {
  2. // module:
  3. // dojo/keys
  4. // summary:
  5. // key constants
  6. // Constants
  7. // Public: client code should test
  8. // keyCode against these named constants, as the
  9. // actual codes can vary by browser.
  10. return dojo.keys = {
  11. // summary:
  12. // Definitions for common key values
  13. BACKSPACE: 8,
  14. TAB: 9,
  15. CLEAR: 12,
  16. ENTER: 13,
  17. SHIFT: 16,
  18. CTRL: 17,
  19. ALT: 18,
  20. META: has("safari") ? 91 : 224, // the apple key on macs
  21. PAUSE: 19,
  22. CAPS_LOCK: 20,
  23. ESCAPE: 27,
  24. SPACE: 32,
  25. PAGE_UP: 33,
  26. PAGE_DOWN: 34,
  27. END: 35,
  28. HOME: 36,
  29. LEFT_ARROW: 37,
  30. UP_ARROW: 38,
  31. RIGHT_ARROW: 39,
  32. DOWN_ARROW: 40,
  33. INSERT: 45,
  34. DELETE: 46,
  35. HELP: 47,
  36. LEFT_WINDOW: 91,
  37. RIGHT_WINDOW: 92,
  38. SELECT: 93,
  39. NUMPAD_0: 96,
  40. NUMPAD_1: 97,
  41. NUMPAD_2: 98,
  42. NUMPAD_3: 99,
  43. NUMPAD_4: 100,
  44. NUMPAD_5: 101,
  45. NUMPAD_6: 102,
  46. NUMPAD_7: 103,
  47. NUMPAD_8: 104,
  48. NUMPAD_9: 105,
  49. NUMPAD_MULTIPLY: 106,
  50. NUMPAD_PLUS: 107,
  51. NUMPAD_ENTER: 108,
  52. NUMPAD_MINUS: 109,
  53. NUMPAD_PERIOD: 110,
  54. NUMPAD_DIVIDE: 111,
  55. F1: 112,
  56. F2: 113,
  57. F3: 114,
  58. F4: 115,
  59. F5: 116,
  60. F6: 117,
  61. F7: 118,
  62. F8: 119,
  63. F9: 120,
  64. F10: 121,
  65. F11: 122,
  66. F12: 123,
  67. F13: 124,
  68. F14: 125,
  69. F15: 126,
  70. NUM_LOCK: 144,
  71. SCROLL_LOCK: 145,
  72. UP_DPAD: 175,
  73. DOWN_DPAD: 176,
  74. LEFT_DPAD: 177,
  75. RIGHT_DPAD: 178,
  76. // virtual key mapping
  77. copyKey: has("mac") && !has("air") ? (has("safari") ? 91 : 224 ) : 17
  78. };
  79. });