keys.py 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # Licensed to the Software Freedom Conservancy (SFC) under one
  2. # or more contributor license agreements. See the NOTICE file
  3. # distributed with this work for additional information
  4. # regarding copyright ownership. The SFC licenses this file
  5. # to you under the Apache License, Version 2.0 (the
  6. # "License"); you may not use this file except in compliance
  7. # with the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing,
  12. # software distributed under the License is distributed on an
  13. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. # KIND, either express or implied. See the License for the
  15. # specific language governing permissions and limitations
  16. # under the License.
  17. """
  18. The Keys implementation.
  19. """
  20. from __future__ import unicode_literals
  21. class Keys(object):
  22. """
  23. Set of special keys codes.
  24. """
  25. NULL = '\ue000'
  26. CANCEL = '\ue001' # ^break
  27. HELP = '\ue002'
  28. BACKSPACE = '\ue003'
  29. BACK_SPACE = BACKSPACE
  30. TAB = '\ue004'
  31. CLEAR = '\ue005'
  32. RETURN = '\ue006'
  33. ENTER = '\ue007'
  34. SHIFT = '\ue008'
  35. LEFT_SHIFT = SHIFT
  36. CONTROL = '\ue009'
  37. LEFT_CONTROL = CONTROL
  38. ALT = '\ue00a'
  39. LEFT_ALT = ALT
  40. PAUSE = '\ue00b'
  41. ESCAPE = '\ue00c'
  42. SPACE = '\ue00d'
  43. PAGE_UP = '\ue00e'
  44. PAGE_DOWN = '\ue00f'
  45. END = '\ue010'
  46. HOME = '\ue011'
  47. LEFT = '\ue012'
  48. ARROW_LEFT = LEFT
  49. UP = '\ue013'
  50. ARROW_UP = UP
  51. RIGHT = '\ue014'
  52. ARROW_RIGHT = RIGHT
  53. DOWN = '\ue015'
  54. ARROW_DOWN = DOWN
  55. INSERT = '\ue016'
  56. DELETE = '\ue017'
  57. SEMICOLON = '\ue018'
  58. EQUALS = '\ue019'
  59. NUMPAD0 = '\ue01a' # number pad keys
  60. NUMPAD1 = '\ue01b'
  61. NUMPAD2 = '\ue01c'
  62. NUMPAD3 = '\ue01d'
  63. NUMPAD4 = '\ue01e'
  64. NUMPAD5 = '\ue01f'
  65. NUMPAD6 = '\ue020'
  66. NUMPAD7 = '\ue021'
  67. NUMPAD8 = '\ue022'
  68. NUMPAD9 = '\ue023'
  69. MULTIPLY = '\ue024'
  70. ADD = '\ue025'
  71. SEPARATOR = '\ue026'
  72. SUBTRACT = '\ue027'
  73. DECIMAL = '\ue028'
  74. DIVIDE = '\ue029'
  75. F1 = '\ue031' # function keys
  76. F2 = '\ue032'
  77. F3 = '\ue033'
  78. F4 = '\ue034'
  79. F5 = '\ue035'
  80. F6 = '\ue036'
  81. F7 = '\ue037'
  82. F8 = '\ue038'
  83. F9 = '\ue039'
  84. F10 = '\ue03a'
  85. F11 = '\ue03b'
  86. F12 = '\ue03c'
  87. META = '\ue03d'
  88. COMMAND = '\ue03d'