[wxPython-users] fixed key bindings in notebook

Robin Dunn robin at alldunn.com
Tue Mar 18 12:08:20 PDT 2008


Franz Steinhäusler wrote:
> Hello, in my app, I want to assign for the stc control:
> ctrl-page up ... for jump to document start
> ctrl-page down ... for jump to document end
> 
> 
> that keys seems to be fixed on changing the current notebook tabs.
> How can I disable that keys, so I can use it in my app?
> (I have my own hotkeys to change between the tabs of the notebook control with alt-cursor left and right).
> 
> The same applies for ctrl-tab and ctr-shift-tab. I want to use that combinations for my own and not letting
> wxpyhton take control over those keys automatically.

It's real hard to intercept the navigation keys before they get stolen 
for the navigation, mainly because they are caught before the focused 
window even sees the event.  You can try using EVT_KEY_DOWN or 
EVT_CHAR_HOOK on the notebook, or maybe EVT_NAVIGATION_KEY, then you can 
make a call from the handler back to the currently active page to do 
whatever you would have done from a normal key event in that class. 
Another option is to try using one of the non-native notebooks.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list