From 30fb9eff1caa7e621ece9ac938722540d0e1daca Mon Sep 17 00:00:00 2001 From: portnov Date: Mon, 1 Sep 2008 11:35:50 +0600 Subject: [PATCH] Change method we recognize digit keys, to work with non-standart keyboard layaouts, such as ru(typewriter). --- qwerty.py | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/qwerty.py b/qwerty.py index a102923..6ee6e97 100755 --- a/qwerty.py +++ b/qwerty.py @@ -42,7 +42,18 @@ KEYS = [ "QWERTYUIOP", "ZXCVBNM" ] ALPHABET = KEYS[0] + KEYS[1] + KEYS[2] -DIGITS = "1234567890" +DIGITS = "1234567890", ['exclam', + 'at', + 'numbersign', + 'dollar', + 'percent', + 'asciicircum', + 'ampersand', + 'asterisk', + 'parenleft', + 'parenright'] + +# DIGITS = '1234567890' BUTTON_BORDER = (0.7,0.7,0.7) BUTTON_BORDER_ACTIVE = (0,0,0) @@ -585,7 +596,7 @@ class GUI(object): for c in ALPHABET: self.buttons[c] = SuperButton(c) - for c in DIGITS: + for c in DIGITS[0]: btn = SectionButton(c) self.sbuttons.append(btn) @@ -801,8 +812,10 @@ class GUI(object): return k = self.get_key(event.hardware_keycode) - if k in DIGITS: + if k in DIGITS[0]: self.show_section(k, mods) + elif k in DIGITS[1]: + self.show_section(DIGITS[0][DIGITS[1].index(k)], mods) elif k == 'space': self.switch_taskbar() elif k in ALPHABET.lower(): -- 1.7.2.3