summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2008-03-18 00:44:54 +0100
committerGuillaume Seguin <guillaume@segu.in>2008-03-18 00:44:54 +0100
commit3b6339529cc6a34ae5519d414f327de81781b855 (patch)
tree59b8a789f0ef1d7e928d344a9691e0f77cda21a3
parentf12d3721d741ec0fdbaf506f194d00c1ade6941f (diff)
downloadenso_linux-3b6339529cc6a34ae5519d414f327de81781b855.tar.gz
enso_linux-3b6339529cc6a34ae5519d414f327de81781b855.tar.bz2
* Fix special keycodes filtering
-rw-r--r--linux/enso_linux/input.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/linux/enso_linux/input.py b/linux/enso_linux/input.py
index df0c1a1..2a01461 100644
--- a/linux/enso_linux/input.py
+++ b/linux/enso_linux/input.py
@@ -84,7 +84,9 @@ CASE_INSENSITIVE_KEYCODE_MAP = {}
def fill_keymap ():
'''Fill keymap'''
- special_keycodes = globals ()
+ global EXTRA_KEYCODES
+ EXTRA_KEYCODES = []
+ special_keycodes = {}
display = get_display ()
for i in range (0, 255):
keyval = display.keycode_to_keysym (i, 0)
@@ -106,6 +108,10 @@ def fill_keymap ():
char = unichr (int (keyval))
if len (char) > 0 and ord (char) > 0:
CASE_INSENSITIVE_KEYCODE_MAP[i] = str (char)
+ vars = globals ()
+ for i in special_keycodes:
+ vars[i] = special_keycodes[i]
+ EXTRA_KEYCODES.append (special_keycodes[i])
fill_keymap ()
@@ -170,8 +176,8 @@ class _KeyListener (Thread):
state = event.state & modifiers_mask
keyval = self.__display.keycode_to_keysym (event.detail,
state)
- char = sanitize_char (keyval)
- if char:
+ if event.detail in EXTRA_KEYCODES \
+ or sanitize_char (keyval):
if event.type == X.KeyPress:
self.__callback (make_event ("keyDown",
event.detail))