English 中文(简体)
What application has mouse control?
原标题:

One way users can cheat with games (desktop or web) is by having "robots" monitor the screen and move the mouse for them. Is there a way (of course with transparency and user permission) to monitor if an application is controlling the mouse? I am primarily interested in a windows app, but if there is a way for other OS s that would be useful to know as well. Thanks!

问题回答

There shouldn t be. Any sensibly designed UI layer will only pass events to the applications, about inputs such as mouse, keyboard etc. Those events will typically not include information about how the event was generated (you re not supposed to care, so why pay for that overhead).

One way might be to scan the system for processes having names of known "event-fakers", much like some anti-virus programs blacklist applications by name.

On Windows you can add a hook to monitor for injected keyboard or mouse messages,
and remove them if you like.

But I m not sure if you can find the source of the messages.

Just an idea: Get the current mouse position and check for fast position changes. Like from (10,15) to (1000, 400). Most robots just set a new position and don t imitate the human mouse movement.





相关问题
Xlib mouse events and ButtonPressMask

I have written a simple program which will report key press and release events for a particular window. In my case, it is mostly the terminal since I invoke the program from the terminal. I am able to ...

Browsers and Windows Messaging

I was asking myself how the browsers are working. How does the browser tell to the OS to change the mouse pointer from arrow to hand(IDC_HAND) for example. In desktop application I know that are used ...

How to get hot node coords of TVirtualStringTree?

I m trying to paint VirtualStringTree s cell differently when mouse is over it. How can I detect the coords of hot node? I know there s a HotNode property but it returns only Node that is under mouse ...

auto permissions on udev d device files?

This is a dupe from SuperUser.com . Folks over there weren t smart enough or willing to help me out; maybe it s more a programmer question than an administrator one: I have an app that reads input ...

热门标签