Dvorak support (also, we need to factor these out...)
authorStefano Rivera <stefano@rivera.za.net>
Tue, 13 May 2014 18:03:29 +0000 (20:03 +0200)
committerStefano Rivera <stefano@rivera.za.net>
Tue, 13 May 2014 18:03:29 +0000 (20:03 +0200)
naja/widgets/info_area.py
naja/widgets/robot.py
naja/widgets/selector.py

index 58068d75429620a7eb40842d741d4f0e05987472..d50c3ad33e2e8a59759190e1b19724ca3ba6984e 100644 (file)
@@ -88,12 +88,12 @@ class InfoAreaWidget(Widget):
                 self.state.gameboard.change_mode()
                 InvalidateTheWorld.post()
                 return True
-            if ev.key in (pgl.K_UP, pgl.K_w):
+            if ev.key in (pgl.K_UP, pgl.K_w, pgl.K_COMMA):
                 if self.chosen > 0:
                     self.chosen -= 1
                     InvalidateTheWorld.post()
                     return True
-            if ev.key in (pgl.K_DOWN, pgl.K_s):
+            if ev.key in (pgl.K_DOWN, pgl.K_s, pgl.K_o):
                 if self.chosen + 1 < len(self.card.actions):
                     self.chosen += 1
                     InvalidateTheWorld.post()
index 3518cb0bb8b41253ad89901221ed55cd386602c8..2653f815aef860b7bc7f06e40aa82d4ab76f457b 100644 (file)
@@ -42,12 +42,12 @@ class RobotWidget(Widget):
         if self.state.gameboard.player_mode == ACT:
             return super(RobotWidget, self).handle_event(ev)
         if ev.type == pgl.KEYDOWN:
-            if ev.key in (pgl.K_UP, pgl.K_w):
+            if ev.key in (pgl.K_UP, pgl.K_w, pgl.K_COMMA):
                 if self.state.player.move(BITS.NORTH):
                     self.state.gameboard.change_mode()
                     InvalidateTheWorld.post()
                     return True
-            if ev.key in (pgl.K_DOWN, pgl.K_s):
+            if ev.key in (pgl.K_DOWN, pgl.K_s, pgl.K_o):
                 if self.state.player.move(BITS.SOUTH):
                     self.state.gameboard.change_mode()
                     InvalidateTheWorld.post()
@@ -57,7 +57,7 @@ class RobotWidget(Widget):
                     self.state.gameboard.change_mode()
                     InvalidateTheWorld.post()
                     return True
-            if ev.key in (pgl.K_RIGHT, pgl.K_d):
+            if ev.key in (pgl.K_RIGHT, pgl.K_d, pgl.K_e):
                 if self.state.player.move(BITS.EAST):
                     self.state.gameboard.change_mode()
                     InvalidateTheWorld.post()
index 5047cf8296a8cfa794f2ee92b32aa5909ee5b345..49cf8d8715048a8371d943c605b112944a6d4371 100644 (file)
@@ -22,8 +22,9 @@ class SelectorWidget(Container):
 
     def handle_event(self, ev):
         if ev.type == pgl.KEYDOWN:
-            if ev.key in (pgl.K_DOWN, pgl.K_UP, pgl.K_s, pgl.K_w):
-                if ev.key in (pgl.K_DOWN, pgl.K_s):
+            if ev.key in (pgl.K_DOWN, pgl.K_s, pgl.K_o,
+                          pgl.K_UP, pgl.K_w, pgl.K_COMMA):
+                if ev.key in (pgl.K_DOWN, pgl.K_s, pgl.K_o):
                     self.position += 1
                 else:
                     self.position -= 1