I am working on a small acceptance test for my OpenGL application written in C. So far, I'm only able to take screenshots and haven't found a way of simulating mouse and keyboard input on both Wayland and X11.
Any suggestions on how to manipulate the event stream of a specific window in Wayland/X11?
1 Answers
Answers 1
For simulating X11
mouse events you have several options:
- If your
X server
supportsXTEST
extension (usually it does), then useXTEST Extension Library
with functions likeXTestFakeKeyEvent
,XTestFakeMotionEvent
, etc. An example - You can use
XLib
functions likeXSendEvent
,XWarpPointer
, etc. An example - If you are under
Linux
and your tests have access to command shell then you can use command line toolxdotool
(which internally usesXTEST extension
. An example
0 comments:
Post a Comment