Browse Source

hotkeys are now lowercase

David Rose 24 years ago
parent
commit
36e47efb6f
2 changed files with 11 additions and 2 deletions
  1. 2 2
      direct/src/directtools/DirectSession.py
  2. 9 0
      direct/src/showbase/ShowBase.py

+ 2 - 2
direct/src/directtools/DirectSession.py

@@ -158,8 +158,8 @@ class DirectSession(PandaObject):
                           'shift', 'shift-up', 'alt', 'alt-up',
                           'shift', 'shift-up', 'alt', 'alt-up',
                           'page_up', 'page_down', 
                           'page_up', 'page_down', 
                           '[', '{', ']', '}',
                           '[', '{', ']', '}',
-                          'shift-a', 'b', 'l', 'L', 'o', 'p', 'r', 'shift-r',
-                          's', 't', 'v', 'w']
+                          'shift-a', 'b', 'l', 'shift-l', 'o', 'p', 'r',
+                          'shift-r', 's', 't', 'v', 'w']
         self.mouseEvents = ['mouse1', 'mouse1-up',
         self.mouseEvents = ['mouse1', 'mouse1-up',
                             'mouse2', 'mouse2-up',
                             'mouse2', 'mouse2-up',
                             'mouse3', 'mouse3-up']
                             'mouse3', 'mouse3-up']

+ 9 - 0
direct/src/showbase/ShowBase.py

@@ -352,8 +352,17 @@ class ShowBase:
         self.mouse2cam.node().setArc(self.camera.arc())
         self.mouse2cam.node().setArc(self.camera.arc())
         self.useDrive()
         self.useDrive()
 
 
+        # A ButtonThrower to generate events from the mouse and
+        # keyboard buttons as they are pressed.
         self.buttonThrower = self.mouseWatcher.attachNewNode(ButtonThrower())
         self.buttonThrower = self.mouseWatcher.attachNewNode(ButtonThrower())
 
 
+        # Specialize the events based on whether the modifier keys are
+        # being held down.
+        mods = ModifierButtons()
+        mods.addButton(KeyboardButton.shift())
+        mods.addButton(KeyboardButton.control())
+        mods.addButton(KeyboardButton.alt())
+        self.buttonThrower.node().setModifierButtons(mods)
 
 
         # Tell the gui system about our new mouse watcher.
         # Tell the gui system about our new mouse watcher.
         self.aspect2d.node().setMouseWatcher(self.mouseWatcherNode)
         self.aspect2d.node().setMouseWatcher(self.mouseWatcherNode)