how can I emulate key press event?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
jacky mo
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Feb 03, 2010 1:58 am

how can I emulate key press event?

Post by jacky mo » Wed Mar 03, 2010 6:58 am

I need to send event to some window.

How can I emulate key press event?

I create event by wxKeyEvent(wxEVT_CHAR), but I can't find how to add press key information?

okurtsev
Experienced Solver
Experienced Solver
Posts: 54
Joined: Mon Jan 25, 2010 3:26 pm
Location: Ukraine, Kiev

Post by okurtsev » Wed Mar 03, 2010 12:18 pm

wxKeyEvent::m_keyCode
it is public.

http://docs.wxwidgets.org/2.6/wx_keycodes.html - here are all possible key codes, except ASCII characters
C++, Win XP-32, Win7-64, WinVista-32, MS VS 2005, 2008, 2010

jacky mo
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Feb 03, 2010 1:58 am

Post by jacky mo » Mon Mar 08, 2010 7:57 am

okurtsev wrote:wxKeyEvent::m_keyCode
it is public.

http://docs.wxwidgets.org/2.6/wx_keycodes.html - here are all possible key codes, except ASCII characters

It's obsoleted now.

jfouche
Super wx Problem Solver
Super wx Problem Solver
Posts: 442
Joined: Tue May 06, 2008 4:52 pm
Location: France

Post by jfouche » Mon Mar 08, 2010 8:36 am

Yes, but looking to the sources, this is the only way. Even in wxWidgets sources, they use the member directly.
Jérémie

Post Reply