Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Util/KeyboardWindow.py
diff options
context:
space:
mode:
authorNat <natcl@hotmail.com>2007-07-05 19:10:26 (GMT)
committer Nat <natcl@hotmail.com>2007-07-05 19:10:26 (GMT)
commit06839311223289f02e1a128efeb1745fcf49ca34 (patch)
tree7353184e42d9f1f883a899d5b0c3a17a2661fd39 /Util/KeyboardWindow.py
parent273444d0cc21603f83b0aebe9643c32839decb02 (diff)
Save stuff
Diffstat (limited to 'Util/KeyboardWindow.py')
-rw-r--r--Util/KeyboardWindow.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Util/KeyboardWindow.py b/Util/KeyboardWindow.py
index 2438170..1463825 100644
--- a/Util/KeyboardWindow.py
+++ b/Util/KeyboardWindow.py
@@ -129,13 +129,15 @@ class KeyboardWindow(gtk.Window):
elif event.hardware_keycode == 133: # Send a fake mouse event
self.btn_dic["right_mouse"].set_fillcolor(random.random(),random.random(),random.random())
else:
- self.btn_dic[event.hardware_keycode].set_fillcolor(random.random(),random.random(),random.random())
+ if self.btn_dic.has_key(event.hardware_keycode):
+ self.btn_dic[event.hardware_keycode].set_fillcolor(random.random(),random.random(),random.random())
def handle_keyrelease(self,widget,event):
if KEY_MAP_PIANO.has_key(event.hardware_keycode):
self.btn_dic[event.hardware_keycode].set_fillcolor(1,1,1)
else:
- self.btn_dic[event.hardware_keycode].set_fillcolor(0,0,0)
+ if self.btn_dic.has_key(event.hardware_keycode):
+ self.btn_dic[event.hardware_keycode].set_fillcolor(0,0,0)
if event.hardware_keycode == 216 or event.hardware_keycode == 133:
self.btn_dic["left_mouse"].set_fillcolor(0,0,0)
self.btn_dic["right_mouse"].set_fillcolor(0,0,0)