How to simulate a click event?
Added by Danil Rzhevsky almost 4 years ago
Hello,
Could you tell me, please, is it possible to simulate a user's mouse click (probably by writing a small script in JavaScript) to generate a WMouseEvent and get the cursor coordinates?
I will describe the situation a bit so that there is more understanding: I have a scheduler that performs one function every 5 minutes. This function should generate a simulation of a click and compare the current cursor coordinates with the previous ones in order to understand whether the user is idle.
If it is possible to implement, what functions should I consider (maybe "createEventCall" is an appropriate option, or are there others)? Maybe there is even a suitable example?
I will be very grateful for your reply, thank you!
Replies (1)
RE: How to simulate a click event? - Added by Roel Standaert almost 4 years ago
I think you're looking for the kind of functionality that is offered by WApplication::idleTimeout()
. This does not take into account mouse moves, though, but it listens on a lot of other events. It does not look at mouse moves because a mouse move could just be the user moving the mouse over the window, not actual interaction.