paul@505 | 1 | #!/usr/bin/env python |
paul@505 | 2 | |
paul@505 | 3 | """ |
paul@505 | 4 | PyGame compatibility package: constant definitions. |
paul@505 | 5 | |
paul@505 | 6 | Copyright (C) 2011 Paul Boddie <paul@boddie.org.uk> |
paul@505 | 7 | Copyright (C) 1997-2006 Sam Lantinga (SDL/SDL_keysym.h, originally LGPL 2.1 or later) |
paul@505 | 8 | |
paul@505 | 9 | This program is free software; you can redistribute it and/or modify it under |
paul@505 | 10 | the terms of the GNU General Public License as published by the Free Software |
paul@505 | 11 | Foundation; either version 3 of the License, or (at your option) any later |
paul@505 | 12 | version. |
paul@505 | 13 | |
paul@505 | 14 | This program is distributed in the hope that it will be useful, but WITHOUT |
paul@505 | 15 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
paul@505 | 16 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
paul@505 | 17 | details. |
paul@505 | 18 | |
paul@505 | 19 | You should have received a copy of the GNU General Public License along with |
paul@505 | 20 | this program. If not, see <http://www.gnu.org/licenses/>. |
paul@505 | 21 | """ |
paul@505 | 22 | |
paul@505 | 23 | # The keyboard syms have been cleverly chosen to map to ASCII. |
paul@505 | 24 | |
paul@505 | 25 | K_UNKNOWN = 0 |
paul@505 | 26 | K_FIRST = 0 |
paul@505 | 27 | K_BACKSPACE = 8 |
paul@505 | 28 | K_TAB = 9 |
paul@505 | 29 | K_CLEAR = 12 |
paul@505 | 30 | K_RETURN = 13 |
paul@505 | 31 | K_PAUSE = 19 |
paul@505 | 32 | K_ESCAPE = 27 |
paul@505 | 33 | K_SPACE = 32 |
paul@505 | 34 | K_EXCLAIM = 33 |
paul@505 | 35 | K_QUOTEDBL = 34 |
paul@505 | 36 | K_HASH = 35 |
paul@505 | 37 | K_DOLLAR = 36 |
paul@505 | 38 | K_AMPERSAND = 38 |
paul@505 | 39 | K_QUOTE = 39 |
paul@505 | 40 | K_LEFTPAREN = 40 |
paul@505 | 41 | K_RIGHTPAREN = 41 |
paul@505 | 42 | K_ASTERISK = 42 |
paul@505 | 43 | K_PLUS = 43 |
paul@505 | 44 | K_COMMA = 44 |
paul@505 | 45 | K_MINUS = 45 |
paul@505 | 46 | K_PERIOD = 46 |
paul@505 | 47 | K_SLASH = 47 |
paul@505 | 48 | K_0 = 48 |
paul@505 | 49 | K_1 = 49 |
paul@505 | 50 | K_2 = 50 |
paul@505 | 51 | K_3 = 51 |
paul@505 | 52 | K_4 = 52 |
paul@505 | 53 | K_5 = 53 |
paul@505 | 54 | K_6 = 54 |
paul@505 | 55 | K_7 = 55 |
paul@505 | 56 | K_8 = 56 |
paul@505 | 57 | K_9 = 57 |
paul@505 | 58 | K_COLON = 58 |
paul@505 | 59 | K_SEMICOLON = 59 |
paul@505 | 60 | K_LESS = 60 |
paul@505 | 61 | K_EQUALS = 61 |
paul@505 | 62 | K_GREATER = 62 |
paul@505 | 63 | K_QUESTION = 63 |
paul@505 | 64 | K_AT = 64 |
paul@505 | 65 | |
paul@505 | 66 | # Skip uppercase letters. |
paul@505 | 67 | |
paul@505 | 68 | K_LEFTBRACKET = 91 |
paul@505 | 69 | K_BACKSLASH = 92 |
paul@505 | 70 | K_RIGHTBRACKET = 93 |
paul@505 | 71 | K_CARET = 94 |
paul@505 | 72 | K_UNDERSCORE = 95 |
paul@505 | 73 | K_BACKQUOTE = 96 |
paul@505 | 74 | K_a = 97 |
paul@505 | 75 | K_b = 98 |
paul@505 | 76 | K_c = 99 |
paul@505 | 77 | K_d = 100 |
paul@505 | 78 | K_e = 101 |
paul@505 | 79 | K_f = 102 |
paul@505 | 80 | K_g = 103 |
paul@505 | 81 | K_h = 104 |
paul@505 | 82 | K_i = 105 |
paul@505 | 83 | K_j = 106 |
paul@505 | 84 | K_k = 107 |
paul@505 | 85 | K_l = 108 |
paul@505 | 86 | K_m = 109 |
paul@505 | 87 | K_n = 110 |
paul@505 | 88 | K_o = 111 |
paul@505 | 89 | K_p = 112 |
paul@505 | 90 | K_q = 113 |
paul@505 | 91 | K_r = 114 |
paul@505 | 92 | K_s = 115 |
paul@505 | 93 | K_t = 116 |
paul@505 | 94 | K_u = 117 |
paul@505 | 95 | K_v = 118 |
paul@505 | 96 | K_w = 119 |
paul@505 | 97 | K_x = 120 |
paul@505 | 98 | K_y = 121 |
paul@505 | 99 | K_z = 122 |
paul@505 | 100 | K_DELETE = 127 |
paul@505 | 101 | # End of ASCII mapped keysyms. |
paul@505 | 102 | |
paul@505 | 103 | # International keyboard syms. |
paul@505 | 104 | |
paul@505 | 105 | K_WORLD_0 = 160 # 0xA0 |
paul@505 | 106 | K_WORLD_1 = 161 |
paul@505 | 107 | K_WORLD_2 = 162 |
paul@505 | 108 | K_WORLD_3 = 163 |
paul@505 | 109 | K_WORLD_4 = 164 |
paul@505 | 110 | K_WORLD_5 = 165 |
paul@505 | 111 | K_WORLD_6 = 166 |
paul@505 | 112 | K_WORLD_7 = 167 |
paul@505 | 113 | K_WORLD_8 = 168 |
paul@505 | 114 | K_WORLD_9 = 169 |
paul@505 | 115 | K_WORLD_10 = 170 |
paul@505 | 116 | K_WORLD_11 = 171 |
paul@505 | 117 | K_WORLD_12 = 172 |
paul@505 | 118 | K_WORLD_13 = 173 |
paul@505 | 119 | K_WORLD_14 = 174 |
paul@505 | 120 | K_WORLD_15 = 175 |
paul@505 | 121 | K_WORLD_16 = 176 |
paul@505 | 122 | K_WORLD_17 = 177 |
paul@505 | 123 | K_WORLD_18 = 178 |
paul@505 | 124 | K_WORLD_19 = 179 |
paul@505 | 125 | K_WORLD_20 = 180 |
paul@505 | 126 | K_WORLD_21 = 181 |
paul@505 | 127 | K_WORLD_22 = 182 |
paul@505 | 128 | K_WORLD_23 = 183 |
paul@505 | 129 | K_WORLD_24 = 184 |
paul@505 | 130 | K_WORLD_25 = 185 |
paul@505 | 131 | K_WORLD_26 = 186 |
paul@505 | 132 | K_WORLD_27 = 187 |
paul@505 | 133 | K_WORLD_28 = 188 |
paul@505 | 134 | K_WORLD_29 = 189 |
paul@505 | 135 | K_WORLD_30 = 190 |
paul@505 | 136 | K_WORLD_31 = 191 |
paul@505 | 137 | K_WORLD_32 = 192 |
paul@505 | 138 | K_WORLD_33 = 193 |
paul@505 | 139 | K_WORLD_34 = 194 |
paul@505 | 140 | K_WORLD_35 = 195 |
paul@505 | 141 | K_WORLD_36 = 196 |
paul@505 | 142 | K_WORLD_37 = 197 |
paul@505 | 143 | K_WORLD_38 = 198 |
paul@505 | 144 | K_WORLD_39 = 199 |
paul@505 | 145 | K_WORLD_40 = 200 |
paul@505 | 146 | K_WORLD_41 = 201 |
paul@505 | 147 | K_WORLD_42 = 202 |
paul@505 | 148 | K_WORLD_43 = 203 |
paul@505 | 149 | K_WORLD_44 = 204 |
paul@505 | 150 | K_WORLD_45 = 205 |
paul@505 | 151 | K_WORLD_46 = 206 |
paul@505 | 152 | K_WORLD_47 = 207 |
paul@505 | 153 | K_WORLD_48 = 208 |
paul@505 | 154 | K_WORLD_49 = 209 |
paul@505 | 155 | K_WORLD_50 = 210 |
paul@505 | 156 | K_WORLD_51 = 211 |
paul@505 | 157 | K_WORLD_52 = 212 |
paul@505 | 158 | K_WORLD_53 = 213 |
paul@505 | 159 | K_WORLD_54 = 214 |
paul@505 | 160 | K_WORLD_55 = 215 |
paul@505 | 161 | K_WORLD_56 = 216 |
paul@505 | 162 | K_WORLD_57 = 217 |
paul@505 | 163 | K_WORLD_58 = 218 |
paul@505 | 164 | K_WORLD_59 = 219 |
paul@505 | 165 | K_WORLD_60 = 220 |
paul@505 | 166 | K_WORLD_61 = 221 |
paul@505 | 167 | K_WORLD_62 = 222 |
paul@505 | 168 | K_WORLD_63 = 223 |
paul@505 | 169 | K_WORLD_64 = 224 |
paul@505 | 170 | K_WORLD_65 = 225 |
paul@505 | 171 | K_WORLD_66 = 226 |
paul@505 | 172 | K_WORLD_67 = 227 |
paul@505 | 173 | K_WORLD_68 = 228 |
paul@505 | 174 | K_WORLD_69 = 229 |
paul@505 | 175 | K_WORLD_70 = 230 |
paul@505 | 176 | K_WORLD_71 = 231 |
paul@505 | 177 | K_WORLD_72 = 232 |
paul@505 | 178 | K_WORLD_73 = 233 |
paul@505 | 179 | K_WORLD_74 = 234 |
paul@505 | 180 | K_WORLD_75 = 235 |
paul@505 | 181 | K_WORLD_76 = 236 |
paul@505 | 182 | K_WORLD_77 = 237 |
paul@505 | 183 | K_WORLD_78 = 238 |
paul@505 | 184 | K_WORLD_79 = 239 |
paul@505 | 185 | K_WORLD_80 = 240 |
paul@505 | 186 | K_WORLD_81 = 241 |
paul@505 | 187 | K_WORLD_82 = 242 |
paul@505 | 188 | K_WORLD_83 = 243 |
paul@505 | 189 | K_WORLD_84 = 244 |
paul@505 | 190 | K_WORLD_85 = 245 |
paul@505 | 191 | K_WORLD_86 = 246 |
paul@505 | 192 | K_WORLD_87 = 247 |
paul@505 | 193 | K_WORLD_88 = 248 |
paul@505 | 194 | K_WORLD_89 = 249 |
paul@505 | 195 | K_WORLD_90 = 250 |
paul@505 | 196 | K_WORLD_91 = 251 |
paul@505 | 197 | K_WORLD_92 = 252 |
paul@505 | 198 | K_WORLD_93 = 253 |
paul@505 | 199 | K_WORLD_94 = 254 |
paul@505 | 200 | K_WORLD_95 = 255 # 0xFF |
paul@505 | 201 | |
paul@505 | 202 | # Numeric keypad. |
paul@505 | 203 | |
paul@505 | 204 | K_KP0 = 256 |
paul@505 | 205 | K_KP1 = 257 |
paul@505 | 206 | K_KP2 = 258 |
paul@505 | 207 | K_KP3 = 259 |
paul@505 | 208 | K_KP4 = 260 |
paul@505 | 209 | K_KP5 = 261 |
paul@505 | 210 | K_KP6 = 262 |
paul@505 | 211 | K_KP7 = 263 |
paul@505 | 212 | K_KP8 = 264 |
paul@505 | 213 | K_KP9 = 265 |
paul@505 | 214 | K_KP_PERIOD = 266 |
paul@505 | 215 | K_KP_DIVIDE = 267 |
paul@505 | 216 | K_KP_MULTIPLY = 268 |
paul@505 | 217 | K_KP_MINUS = 269 |
paul@505 | 218 | K_KP_PLUS = 270 |
paul@505 | 219 | K_KP_ENTER = 271 |
paul@505 | 220 | K_KP_EQUALS = 272 |
paul@505 | 221 | |
paul@505 | 222 | # Arrows + Home/End pad. |
paul@505 | 223 | |
paul@505 | 224 | K_UP = 273 |
paul@505 | 225 | K_DOWN = 274 |
paul@505 | 226 | K_RIGHT = 275 |
paul@505 | 227 | K_LEFT = 276 |
paul@505 | 228 | K_INSERT = 277 |
paul@505 | 229 | K_HOME = 278 |
paul@505 | 230 | K_END = 279 |
paul@505 | 231 | K_PAGEUP = 280 |
paul@505 | 232 | K_PAGEDOWN = 281 |
paul@505 | 233 | |
paul@505 | 234 | # Function keys. |
paul@505 | 235 | |
paul@505 | 236 | K_F1 = 282 |
paul@505 | 237 | K_F2 = 283 |
paul@505 | 238 | K_F3 = 284 |
paul@505 | 239 | K_F4 = 285 |
paul@505 | 240 | K_F5 = 286 |
paul@505 | 241 | K_F6 = 287 |
paul@505 | 242 | K_F7 = 288 |
paul@505 | 243 | K_F8 = 289 |
paul@505 | 244 | K_F9 = 290 |
paul@505 | 245 | K_F10 = 291 |
paul@505 | 246 | K_F11 = 292 |
paul@505 | 247 | K_F12 = 293 |
paul@505 | 248 | K_F13 = 294 |
paul@505 | 249 | K_F14 = 295 |
paul@505 | 250 | K_F15 = 296 |
paul@505 | 251 | |
paul@505 | 252 | # Key state modifier keys. |
paul@505 | 253 | |
paul@505 | 254 | K_NUMLOCK = 300 |
paul@505 | 255 | K_CAPSLOCK = 301 |
paul@505 | 256 | K_SCROLLOCK = 302 |
paul@505 | 257 | K_RSHIFT = 303 |
paul@505 | 258 | K_LSHIFT = 304 |
paul@505 | 259 | K_RCTRL = 305 |
paul@505 | 260 | K_LCTRL = 306 |
paul@505 | 261 | K_RALT = 307 |
paul@505 | 262 | K_LALT = 308 |
paul@505 | 263 | K_RMETA = 309 |
paul@505 | 264 | K_LMETA = 310 |
paul@505 | 265 | K_LSUPER = 311 # Left "Windows" key |
paul@505 | 266 | K_RSUPER = 312 # Right "Windows" key |
paul@505 | 267 | K_MODE = 313 # "Alt Gr" key |
paul@505 | 268 | K_COMPOSE = 314 # Multi-key compose key |
paul@505 | 269 | |
paul@505 | 270 | # Miscellaneous function keys. |
paul@505 | 271 | |
paul@505 | 272 | K_HELP = 315 |
paul@505 | 273 | K_PRINT = 316 |
paul@505 | 274 | K_SYSREQ = 317 |
paul@505 | 275 | K_BREAK = 318 |
paul@505 | 276 | K_MENU = 319 |
paul@505 | 277 | K_POWER = 320 # Power Macintosh power key |
paul@505 | 278 | K_EURO = 321 # Some european keyboards |
paul@505 | 279 | K_UNDO = 322 # Atari keyboard has Undo |
paul@505 | 280 | |
paul@505 | 281 | # vim: tabstop=4 expandtab shiftwidth=4 |