Open GoogleCodeExporter opened 9 years ago
Patched in maintenance r2534
Original comment by benjamin...@gmail.com
on 1 Nov 2009 at 7:38
My Thinkpad's "Fn" button generates some kind of exotic astral character when
pressed (namely, 0x1008ff2b), which causes Pyglet to explode:
Traceback (most recent call last):
File ".../game/mainwindow.py", line 107, in run
window.run()
File ".../python2.6/site-packages/pyglet/app/__init__.py", line 264, in run
EventLoop().run()
File ".../python2.6/site-packages/pyglet/app/xlib.py", line 82, in run
window.dispatch_platform_event(e)
File ".../python2.6/site-packages/pyglet/window/xlib/__init__.py", line 1169, in dispatch_platform_event
event_handler(e)
File ".../python2.6/site-packages/pyglet/window/xlib/__init__.py", line 1326, in _event_key
text, symbol = self._event_text_symbol(ev)
File ".../python2.6/site-packages/pyglet/window/xlib/__init__.py", line 1262, in _event_text_symbol
symbol = ord(unichr(symbol).lower())
ValueError: unichr() arg not in range(0x110000) (wide Python build)
Proposed patch:
--- pyglet/window/xlib/__init__.py 2011-02-21 04:14:33.189914001 +0200
+++ pyglet/window/xlib/__init__.py 2011-02-21 04:20:01.000000000 +0200
@@ -1259,14 +1259,11 @@
# raw key code to a user key.
if symbol and symbol not in key._key_names and ev.xkey.keycode:
# Issue 353: Symbol is uppercase when shift key held down.
- try:
- symbol = ord(unichr(symbol).lower())
- except ValueError:
- pass
- else:
- # If still not recognised, use the keycode
- if symbol not in key._key_names:
- symbol = key.user_key(ev.xkey.keycode)
+ symbol = ord(unichr(symbol).lower())
+
+ # If still not recognised, use the keycode
+ if symbol not in key._key_names:
+ symbol = key.user_key(ev.xkey.keycode)
if filtered:
# The event was filtered, text must be ignored, but the symbol is
Original comment by encu...@gmail.com
on 21 Feb 2011 at 2:21
Original issue reported on code.google.com by
encu...@gmail.com
on 4 Sep 2009 at 4:20