开发者

Generating a keypress event in wxWidgets programatically

开发者 https://www.devze.com 2023-01-12 03:39 出处:网络
I\'m looking for a way to programatically generate keypress events in a C++ wxWidgets app,for testing a control that I had written.

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

精彩评论

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