|
View:
New views
1 Messages
—
Rating Filter:
Alert me
|
|
|
dabo Commit 4304dabo Commit
Revision 4304 Date: 2008-07-21 12:07:07 -0700 (Mon, 21 Jul 2008) Author: Nate Trac: http://svn.dabodev.com/trac/dabo/changeset/4304 Changed: U trunk/dabo/ui/uiwx/dShell.py Log: 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. Diff: Modified: trunk/dabo/ui/uiwx/dShell.py =================================================================== --- trunk/dabo/ui/uiwx/dShell.py 2008-07-21 19:06:04 UTC (rev 4303) +++ trunk/dabo/ui/uiwx/dShell.py 2008-07-21 19:07:07 UTC (rev 4304) @@ -49,7 +49,7 @@ return elif kc == dKeys.key_Escape: self.closeDialog(False) - if kc in dKeys.arrows or char is None: + if kc in dKeys.arrowKeys.values() or char is None: #ignore return if kc == dKeys.key_Back: @@ -328,8 +328,13 @@ cp.Sizer.append1x(self.shell) self.shell.Bind(wx.EVT_RIGHT_UP, self.shellRight) - self.shell.bindEvent(dEvents.KeyDown, self.onShellKeyDown) + if self.Application.Platform == "Mac": + keybnd = "cmd+R" + else: + keybnd = "ctrl+R" + self.bindKey(keybnd, self.onHistoryPop) + # Restore the history self.restoreHistory() @@ -379,13 +384,6 @@ self.cmdHistKey.setValue(stamp, cmd) - def onShellKeyDown(self, evt): - if evt.controlDown and evt.keyChar in ("r", "R"): - if not (evt.commandDown or evt.altDown or evt.metaDown): - evt.stop() - self.historyPop() - - def _loadHistory(self): ck = self.cmdHistKey cmds = [] @@ -399,7 +397,7 @@ return dsu - def historyPop(self): + def onHistoryPop(self, evt): """Let the user type in part of a command, and retrieve the matching commands from their history. """ _______________________________________________ Post Messages to: Dabo-dev@... Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev Searchable Archives: http://leafe.com/archives/search/dabo-dev This message: http://leafe.com/archives/byMID/20080721190707.B6ADE3188D9@... |
| Free Forum Powered by Nabble | Forum Help |