Changeset 4304

Show
Ignore:
Timestamp:
07/21/08 12:07:07 (4 months ago)
Author:
nate
Message:

For some reason, the dShell form was intercepting key characters with "Ctrl+Character" and stopping the KeyDown? event from firing on Windows. Now, instead of catching the KeyDown? event and looking for the specific sequence, the form's bindKey method is used instead. This works on Windows. I have bound cmd+R to Mac, but I need someone to test the changes.

Also, I fixed a typo in _LookupPanel's onListKey. dKeys.arrows should be dKeys.arrowKeys. arrowKeys is a dict, so we need to reference values. Again, test the changes on Mac.

Lastly, on Windows, I am still having trouble in onListKey with the return and numpad_enter key events propagating. Events are fired as getEventData is called, but something is stopping the event before it makes it through.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/ui/uiwx/dShell.py

    r4302 r4304  
    5050        elif kc == dKeys.key_Escape: 
    5151            self.closeDialog(False) 
    52         if kc in dKeys.arrows or char is None: 
     52        if kc in dKeys.arrowKeys.values() or char is None: 
    5353            #ignore 
    5454            return 
     
    329329        cp.Sizer.append1x(self.shell) 
    330330        self.shell.Bind(wx.EVT_RIGHT_UP, self.shellRight) 
    331         self.shell.bindEvent(dEvents.KeyDown, self.onShellKeyDown) 
     331         
     332        if self.Application.Platform == "Mac": 
     333            keybnd = "cmd+R" 
     334        else: 
     335            keybnd = "ctrl+R" 
     336        self.bindKey(keybnd, self.onHistoryPop) 
    332337         
    333338        # Restore the history 
     
    380385 
    381386 
    382     def onShellKeyDown(self, evt): 
    383         if evt.controlDown and evt.keyChar in ("r", "R"): 
    384             if not (evt.commandDown or evt.altDown or evt.metaDown): 
    385                 evt.stop() 
    386                 self.historyPop() 
    387  
    388  
    389387    def _loadHistory(self): 
    390388        ck = self.cmdHistKey 
     
    400398 
    401399 
    402     def historyPop(self): 
     400    def onHistoryPop(self, evt): 
    403401        """Let the user type in part of a command, and retrieve the matching commands 
    404402        from their history.