Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornrp <olpc@spongezone.net>2008-09-14 02:40:41 (GMT)
committer nrp <olpc@spongezone.net>2008-09-14 02:40:41 (GMT)
commit37ae3d3c5dfd0627f80f5d591a64024dc9491c95 (patch)
tree73355190fdc4dd1ce58a829f659867acb473b811
parentee2d3d16185c595cc36d37d47b4cd605990b1d59 (diff)
fix crashes on unused keys
-rw-r--r--tools.py43
1 files changed, 2 insertions, 41 deletions
diff --git a/tools.py b/tools.py
index 086aa80..8fc1261 100644
--- a/tools.py
+++ b/tools.py
@@ -41,54 +41,15 @@ class Tool(object):
elif event.key == K_t:
self.game.bridge.create_train(force=True)
elif event.key == K_b:
- self.game.setTool("box")
+ self.game.setTool("girder")
elif event.key == K_c:
self.game.setTool("circle")
elif event.key == K_j:
- self.game.setTool("joint")
- elif event.key == K_p:
- self.game.setTool("polygon")
+ self.game.setTool("bridgejoint")
elif event.key == K_g:
self.game.setTool("grab")
elif event.key == K_d:
self.game.setTool("destroy")
- elif event.key == K_m:
- self.game.setTool("magicpen")
- #elif event.key == K_g:
- # self.game.setTool("gear")
- # Game/joystick-related keys
- elif event.key == K_KP4: # Left gamepad, left arrow
- if self.game.joystickobject:
- self.game.joystickobject[0].ApplyTorque(9000)
- elif self.game.debug: print "Left gamepad left arrow error: no joystick object selected"
- elif event.key == K_KP6: # Left gamepad, right arrow
- if self.game.joystickobject:
- self.game.joystickobject[0].ApplyTorque(9000)
- elif self.game.debug: print "Left gamepad right arrow error: no joystick object selected"
- elif event.key == K_KP8: # Left gamepad, up arrow
- if self.game.joystickobject:
- self.game.joystickobject[0].ApplyTorque(9000)
- elif self.game.debug: print "Left gamepad up arrow error: no joystick object selected"
- elif event.key == K_KP2: # Left gamepad, down arrow
- if self.game.joystickobject:
- self.game.joystickobject[0].ApplyTorque(9000)
- elif self.game.debug: print "Left gamepad down arrow error: no joystick object selected"
- elif event.key == K_KP7: # Right gamepad, square
- if self.game.joystickobject:
- self.game.joystickobject[0].ApplyTorque(-9000)
- elif self.game.debug: print "Right gamepad square button error: no joystick object selected"
- elif event.key == K_KP1: # Right gamepad, check
- if self.game.joystickobject:
- self.game.joystickobject[0].ApplyTorque(-9000)
- elif self.game.debug: print "Right gamepad check button error: no joystick object selected"
- elif event.key == K_KP9: # Right gamepad, circle
- if self.game.joystickobject:
- self.game.joystickobject[0].ApplyTorque(-9000)
- elif self.game.debug: print "Right gamepad circle button error: no joystick object selected"
- elif event.key == K_KP3: # Right gamepad, X
- if self.game.joystickobject:
- self.game.joystickobject[0].ApplyTorque(-9000)
- elif self.game.debug: print "Right gamepad X button error: no joystick object selected"
elif event.type == USEREVENT:
if hasattr(event,"action"):
if self.game.toolList.has_key(event.action): self.game.setTool(event.action)