micropython

Changeset

505:b379d0e57dca
2012-05-17 Paul Boddie raw files shortlog changelog graph Added PyGame emulation stubs.
lib/pygame/__init__.py (file) lib/pygame/constants.py (file)
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/lib/pygame/__init__.py	Thu May 17 23:37:05 2012 +0200
     1.3 @@ -0,0 +1,24 @@
     1.4 +#!/usr/bin/env python
     1.5 +
     1.6 +"""
     1.7 +PyGame compatibility package.
     1.8 +
     1.9 +Copyright (C) 2011 Paul Boddie <paul@boddie.org.uk>
    1.10 +
    1.11 +This program is free software; you can redistribute it and/or modify it under
    1.12 +the terms of the GNU General Public License as published by the Free Software
    1.13 +Foundation; either version 3 of the License, or (at your option) any later
    1.14 +version.
    1.15 +
    1.16 +This program is distributed in the hope that it will be useful, but WITHOUT
    1.17 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    1.18 +FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
    1.19 +details.
    1.20 +
    1.21 +You should have received a copy of the GNU General Public License along with
    1.22 +this program.  If not, see <http://www.gnu.org/licenses/>.
    1.23 +"""
    1.24 +
    1.25 +from pygame.constants import *
    1.26 +
    1.27 +# vim: tabstop=4 expandtab shiftwidth=4
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/lib/pygame/constants.py	Thu May 17 23:37:05 2012 +0200
     2.3 @@ -0,0 +1,281 @@
     2.4 +#!/usr/bin/env python
     2.5 +
     2.6 +"""
     2.7 +PyGame compatibility package: constant definitions.
     2.8 +
     2.9 +Copyright (C) 2011 Paul Boddie <paul@boddie.org.uk>
    2.10 +Copyright (C) 1997-2006 Sam Lantinga (SDL/SDL_keysym.h, originally LGPL 2.1 or later)
    2.11 +
    2.12 +This program is free software; you can redistribute it and/or modify it under
    2.13 +the terms of the GNU General Public License as published by the Free Software
    2.14 +Foundation; either version 3 of the License, or (at your option) any later
    2.15 +version.
    2.16 +
    2.17 +This program is distributed in the hope that it will be useful, but WITHOUT
    2.18 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    2.19 +FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
    2.20 +details.
    2.21 +
    2.22 +You should have received a copy of the GNU General Public License along with
    2.23 +this program.  If not, see <http://www.gnu.org/licenses/>.
    2.24 +"""
    2.25 +
    2.26 +# The keyboard syms have been cleverly chosen to map to ASCII.
    2.27 +
    2.28 +K_UNKNOWN       = 0
    2.29 +K_FIRST         = 0
    2.30 +K_BACKSPACE     = 8
    2.31 +K_TAB           = 9
    2.32 +K_CLEAR         = 12
    2.33 +K_RETURN        = 13
    2.34 +K_PAUSE         = 19
    2.35 +K_ESCAPE        = 27
    2.36 +K_SPACE         = 32
    2.37 +K_EXCLAIM       = 33
    2.38 +K_QUOTEDBL      = 34
    2.39 +K_HASH          = 35
    2.40 +K_DOLLAR        = 36
    2.41 +K_AMPERSAND     = 38
    2.42 +K_QUOTE         = 39
    2.43 +K_LEFTPAREN     = 40
    2.44 +K_RIGHTPAREN    = 41
    2.45 +K_ASTERISK      = 42
    2.46 +K_PLUS          = 43
    2.47 +K_COMMA         = 44
    2.48 +K_MINUS         = 45
    2.49 +K_PERIOD        = 46
    2.50 +K_SLASH         = 47
    2.51 +K_0             = 48
    2.52 +K_1             = 49
    2.53 +K_2             = 50
    2.54 +K_3             = 51
    2.55 +K_4             = 52
    2.56 +K_5             = 53
    2.57 +K_6             = 54
    2.58 +K_7             = 55
    2.59 +K_8             = 56
    2.60 +K_9             = 57
    2.61 +K_COLON         = 58
    2.62 +K_SEMICOLON     = 59
    2.63 +K_LESS          = 60
    2.64 +K_EQUALS        = 61
    2.65 +K_GREATER       = 62
    2.66 +K_QUESTION      = 63
    2.67 +K_AT            = 64
    2.68 +
    2.69 +# Skip uppercase letters.
    2.70 +
    2.71 +K_LEFTBRACKET   = 91
    2.72 +K_BACKSLASH     = 92
    2.73 +K_RIGHTBRACKET  = 93
    2.74 +K_CARET         = 94
    2.75 +K_UNDERSCORE    = 95
    2.76 +K_BACKQUOTE     = 96
    2.77 +K_a             = 97
    2.78 +K_b             = 98
    2.79 +K_c             = 99
    2.80 +K_d             = 100
    2.81 +K_e             = 101
    2.82 +K_f             = 102
    2.83 +K_g             = 103
    2.84 +K_h             = 104
    2.85 +K_i             = 105
    2.86 +K_j             = 106
    2.87 +K_k             = 107
    2.88 +K_l             = 108
    2.89 +K_m             = 109
    2.90 +K_n             = 110
    2.91 +K_o             = 111
    2.92 +K_p             = 112
    2.93 +K_q             = 113
    2.94 +K_r             = 114
    2.95 +K_s             = 115
    2.96 +K_t             = 116
    2.97 +K_u             = 117
    2.98 +K_v             = 118
    2.99 +K_w             = 119
   2.100 +K_x             = 120
   2.101 +K_y             = 121
   2.102 +K_z             = 122
   2.103 +K_DELETE        = 127
   2.104 +# End of ASCII mapped keysyms.
   2.105 +
   2.106 +# International keyboard syms.
   2.107 +
   2.108 +K_WORLD_0       = 160       # 0xA0
   2.109 +K_WORLD_1       = 161
   2.110 +K_WORLD_2       = 162
   2.111 +K_WORLD_3       = 163
   2.112 +K_WORLD_4       = 164
   2.113 +K_WORLD_5       = 165
   2.114 +K_WORLD_6       = 166
   2.115 +K_WORLD_7       = 167
   2.116 +K_WORLD_8       = 168
   2.117 +K_WORLD_9       = 169
   2.118 +K_WORLD_10      = 170
   2.119 +K_WORLD_11      = 171
   2.120 +K_WORLD_12      = 172
   2.121 +K_WORLD_13      = 173
   2.122 +K_WORLD_14      = 174
   2.123 +K_WORLD_15      = 175
   2.124 +K_WORLD_16      = 176
   2.125 +K_WORLD_17      = 177
   2.126 +K_WORLD_18      = 178
   2.127 +K_WORLD_19      = 179
   2.128 +K_WORLD_20      = 180
   2.129 +K_WORLD_21      = 181
   2.130 +K_WORLD_22      = 182
   2.131 +K_WORLD_23      = 183
   2.132 +K_WORLD_24      = 184
   2.133 +K_WORLD_25      = 185
   2.134 +K_WORLD_26      = 186
   2.135 +K_WORLD_27      = 187
   2.136 +K_WORLD_28      = 188
   2.137 +K_WORLD_29      = 189
   2.138 +K_WORLD_30      = 190
   2.139 +K_WORLD_31      = 191
   2.140 +K_WORLD_32      = 192
   2.141 +K_WORLD_33      = 193
   2.142 +K_WORLD_34      = 194
   2.143 +K_WORLD_35      = 195
   2.144 +K_WORLD_36      = 196
   2.145 +K_WORLD_37      = 197
   2.146 +K_WORLD_38      = 198
   2.147 +K_WORLD_39      = 199
   2.148 +K_WORLD_40      = 200
   2.149 +K_WORLD_41      = 201
   2.150 +K_WORLD_42      = 202
   2.151 +K_WORLD_43      = 203
   2.152 +K_WORLD_44      = 204
   2.153 +K_WORLD_45      = 205
   2.154 +K_WORLD_46      = 206
   2.155 +K_WORLD_47      = 207
   2.156 +K_WORLD_48      = 208
   2.157 +K_WORLD_49      = 209
   2.158 +K_WORLD_50      = 210
   2.159 +K_WORLD_51      = 211
   2.160 +K_WORLD_52      = 212
   2.161 +K_WORLD_53      = 213
   2.162 +K_WORLD_54      = 214
   2.163 +K_WORLD_55      = 215
   2.164 +K_WORLD_56      = 216
   2.165 +K_WORLD_57      = 217
   2.166 +K_WORLD_58      = 218
   2.167 +K_WORLD_59      = 219
   2.168 +K_WORLD_60      = 220
   2.169 +K_WORLD_61      = 221
   2.170 +K_WORLD_62      = 222
   2.171 +K_WORLD_63      = 223
   2.172 +K_WORLD_64      = 224
   2.173 +K_WORLD_65      = 225
   2.174 +K_WORLD_66      = 226
   2.175 +K_WORLD_67      = 227
   2.176 +K_WORLD_68      = 228
   2.177 +K_WORLD_69      = 229
   2.178 +K_WORLD_70      = 230
   2.179 +K_WORLD_71      = 231
   2.180 +K_WORLD_72      = 232
   2.181 +K_WORLD_73      = 233
   2.182 +K_WORLD_74      = 234
   2.183 +K_WORLD_75      = 235
   2.184 +K_WORLD_76      = 236
   2.185 +K_WORLD_77      = 237
   2.186 +K_WORLD_78      = 238
   2.187 +K_WORLD_79      = 239
   2.188 +K_WORLD_80      = 240
   2.189 +K_WORLD_81      = 241
   2.190 +K_WORLD_82      = 242
   2.191 +K_WORLD_83      = 243
   2.192 +K_WORLD_84      = 244
   2.193 +K_WORLD_85      = 245
   2.194 +K_WORLD_86      = 246
   2.195 +K_WORLD_87      = 247
   2.196 +K_WORLD_88      = 248
   2.197 +K_WORLD_89      = 249
   2.198 +K_WORLD_90      = 250
   2.199 +K_WORLD_91      = 251
   2.200 +K_WORLD_92      = 252
   2.201 +K_WORLD_93      = 253
   2.202 +K_WORLD_94      = 254
   2.203 +K_WORLD_95      = 255       # 0xFF
   2.204 +
   2.205 +# Numeric keypad.
   2.206 +
   2.207 +K_KP0           = 256
   2.208 +K_KP1           = 257
   2.209 +K_KP2           = 258
   2.210 +K_KP3           = 259
   2.211 +K_KP4           = 260
   2.212 +K_KP5           = 261
   2.213 +K_KP6           = 262
   2.214 +K_KP7           = 263
   2.215 +K_KP8           = 264
   2.216 +K_KP9           = 265
   2.217 +K_KP_PERIOD     = 266
   2.218 +K_KP_DIVIDE     = 267
   2.219 +K_KP_MULTIPLY   = 268
   2.220 +K_KP_MINUS      = 269
   2.221 +K_KP_PLUS       = 270
   2.222 +K_KP_ENTER      = 271
   2.223 +K_KP_EQUALS     = 272
   2.224 +
   2.225 +# Arrows + Home/End pad.
   2.226 +
   2.227 +K_UP            = 273
   2.228 +K_DOWN          = 274
   2.229 +K_RIGHT         = 275
   2.230 +K_LEFT          = 276
   2.231 +K_INSERT        = 277
   2.232 +K_HOME          = 278
   2.233 +K_END           = 279
   2.234 +K_PAGEUP        = 280
   2.235 +K_PAGEDOWN      = 281
   2.236 +
   2.237 +# Function keys.
   2.238 +
   2.239 +K_F1            = 282
   2.240 +K_F2            = 283
   2.241 +K_F3            = 284
   2.242 +K_F4            = 285
   2.243 +K_F5            = 286
   2.244 +K_F6            = 287
   2.245 +K_F7            = 288
   2.246 +K_F8            = 289
   2.247 +K_F9            = 290
   2.248 +K_F10           = 291
   2.249 +K_F11           = 292
   2.250 +K_F12           = 293
   2.251 +K_F13           = 294
   2.252 +K_F14           = 295
   2.253 +K_F15           = 296
   2.254 +
   2.255 +# Key state modifier keys.
   2.256 +
   2.257 +K_NUMLOCK       = 300
   2.258 +K_CAPSLOCK      = 301
   2.259 +K_SCROLLOCK     = 302
   2.260 +K_RSHIFT        = 303
   2.261 +K_LSHIFT        = 304
   2.262 +K_RCTRL         = 305
   2.263 +K_LCTRL         = 306
   2.264 +K_RALT          = 307
   2.265 +K_LALT          = 308
   2.266 +K_RMETA         = 309
   2.267 +K_LMETA         = 310
   2.268 +K_LSUPER        = 311       # Left "Windows" key
   2.269 +K_RSUPER        = 312       # Right "Windows" key
   2.270 +K_MODE          = 313       # "Alt Gr" key
   2.271 +K_COMPOSE       = 314       # Multi-key compose key
   2.272 +
   2.273 +# Miscellaneous function keys.
   2.274 +
   2.275 +K_HELP          = 315
   2.276 +K_PRINT         = 316
   2.277 +K_SYSREQ        = 317
   2.278 +K_BREAK         = 318
   2.279 +K_MENU          = 319
   2.280 +K_POWER         = 320       # Power Macintosh power key
   2.281 +K_EURO          = 321       # Some european keyboards
   2.282 +K_UNDO          = 322       # Atari keyboard has Undo
   2.283 +
   2.284 +# vim: tabstop=4 expandtab shiftwidth=4