Handling key down events between multiple objects

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
ouch67
Earned some good credits
Earned some good credits
Posts: 135
Joined: Sun Mar 23, 2008 12:09 am

Handling key down events between multiple objects

Post by ouch67 »

So I know this gets asked a lot but i couldn't find an answer for my specific needs.

So I have have 2 wxgrid objects on a frame. Each grid has it's own copy and paste keyboard shortcuts. These are needed so that you copy and paste from the correct wxgrid. These work great, however now I want to add a keyboard shortcut to save the contents of both. The problem I am having is that the database that they are being saved too is owned by the frame as well as the function that saves them. (different tabs save to different parts of the database, so the frame has to own it) And when I add key down events on the frame they never get processed because one of the grids has focus.

What is the best way to handle this situation?
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Re: Handling key down events between multiple objects

Post by Auria »

you can probably find a solution here : http://wiki.wxwidgets.org/Catching_key_events_globally
simplest is probably to assign a keyboard shortcut to a menu item, if you have a menu
"Keyboard not detected. Press F1 to continue"
-- Windows
Post Reply