Thanks for the tip. I followed the trail of bread crumbs and found this in
app.cpp:
// try translations first: the accelerators override everything
wxWindow *wnd;
for ( wnd = wndThis; wnd; wnd = wnd->GetParent() )
{
if ( wnd->MSWTranslateMessage(wxmsg))
return TRUE;
// stop at first top level window, i.e. don't try to process the key
// strokes originating in a dialog using the accelerators of the
parent
// frame - this doesn't make much sense
if ( wnd->IsTopLevel() )
break;
}
So I put an entry in my accelerator table and wrote the following handler.
All is right with
the world once more...
...
(wxACCEL_SHIFT, WXK_TAB, ID_SCRIPT_LEFTSHIFT),#not on menu
...
def OnScriptLeftshift(self, event):
doc = self.scriptnbk.GetActiveDoc()
if doc != None:
pass #let document handle it through existing handlers
else:
event.Skip()
···
-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Thursday, January 17, 2002 9:47 AM
To: wxpython-users@lists.wxwindows.org
Subject: Re: [wxPython] Frames and Shift-Tab
I was off this software project for a short time, but I have some time
again...
I was about to strip my app down to bare bones and send it as a sample of
the problem, but then noticed the wxPython demo has the same issue. To
duplicate:
1. open the demo
2. click on one of the notebook tabs, just for grins
3. Do shift-tab or tab.
Shift-tab and tab cycle through the splitter windows.I have been looking in numerous places, including wxWindows source, to
find
who/what captures these keystrokes and how I can intercept them, but have
not yet found it. Any ideas on where the handler lives?
In wxWindows/src/msw/window.cpp around line 1800:
switch ( msg->wParam )
{
case VK_TAB:
// assume that nobody wants Shift-TAB for himself - if we
// don't do it there is no easy way for a control to grab
// TABs but still let Shift-TAB work as navigation key
if ( (lDlgCode & DLGC_WANTTAB) && !bShiftDown ) {
bProcess = FALSE;
}
else {
// Ctrl-Tab cycles thru notebook pages
bWindowChange = bCtrlDown;
bForward = !bShiftDown;
}
break;
Thanks.
(I haven't asked on wx-users yet 'cause I don't know the list name, and
the
wxWindows site appears to be down so I can't look it up :{ )
We've got links on the wxPython pages too
(http://www.wxpython.org/maillist.php) but you can get to all wx lists at
http://lists.wxwindows.org/.
wx-dev is probably the place to take issue with this. I'm not sure why the
code above has to be the way it is but I do know that the navigation key
code has been reworked a few times, trying to work around microsoft API
problems. I can almost guarantee that the answer you'll get to any
navigation key issue is something like, "It will have to wait until I can
completely rewrite it." <wink>
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users