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