views:

21

answers:

2

Hi,

I'm looking for a way to programatically generate keypress events in a C++ wxWidgets app, for testing a control that I had written.

Are there ways to do this?

Thanks a lot for the help!

Sahas

A: 

There is/will be wxUIActionSimulator in wx 2.9 soon (it's currently present in basic form in the trunk and in an improved one in one of svn branches which will be merged soon). You should be able to take the relevant files and use them with wx 2.8 too if you need but I haven't tested this.

VZ
Thanks for the link, but apparently it is only for Windows, but I want a solution that would work on Linux
Sahasranaman MS
It should work under all platforms once it's merged.
VZ
A: 

You should first build a wxKeyEvent object, fill it with the necessary key information, and then call the ProcessEvent method of the target control.

Rui Curado