Xtst and usleep
Asked Answered
A

1

7

I'm using the Xtst extentsion to type and do stuff using the mouse I have not encoutnered any problems untill I started using xtst to move and click the mouse.

for example, here's a set of action: move 359,216 & click (XTestFakeMotionEvent(display,-1,359,216,0);) move 378,213 & click move 376,391 & click type [email protected], [email protected] (the string is broken down into characters and then XTestFakeKeyEvent(display, keycode, True, 0); this code has been working fine for the past couple of months, til I started using mouse movements and clicks move 438,727 & click

plenty of other clicks

what happens is all mouse movements work fine, the typing events are not sent/synced unless I use usleep of: 100 before each letter typed 500 before each click 700000 before each mouse movements

mouse movement usleeps are slowing down the app severely the code is as follows for mouse movement:

XFlush(display);
usleep(700000);
XTestFakeMotionEvent(display,-1,x_coordinate,y_coordinate,0);

XFlush(display);
  XCloseDisplay(display);

should I keep the display open and use a pointer instead(I'm calling these functions within a function) should I flush more/less often

thanks

Amalea answered 27/10, 2015 at 0:25 Comment(0)
D
0

I think keyboard Auto repeat settings in your desktop environment, may have an impact on the behaviour of the program

Deutoplasm answered 27/6, 2016 at 9:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.