开发者

Generating a keypress event in wxWidgets programatically

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 thi开发者_C百科s?

Thanks a lot for the help!

Sahas


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜