Search code examples
eventswxwidgets

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 this?

Thanks a lot for the help!

Sahas


Solution

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