SetWindowsHookEx -Issue Intercepting\Blocking Mouse Movement in Game

荒凉一梦 提交于 2020-01-16 08:34:28

问题


Here is the thing:

I defined a "P" shortcut\hotkey to move mouse to a specific x y coord, so, when "P" key is pressed in game, the game's camera moves (if in game's menu the mouse cursor moves)!

Now the problem is, I use "SetWindowsHookEx" to intercept\block mouse movement, so, when "P" key is pressed, the mouse cursor in game's menu does not move because it is intercepted\blocked, but if not in menu "P" key can still move the game's camera (which would mean that mouse is not intercepted\blocked?)!

My question is, if "P" shortcut\hotkey can move game's camera, so it would mean that the game controls camera not based on mouse DirectInput but based on something else?

What would be this "something else" and how could it be intercepted\blocked in order to prevent game's camera to be moved?

[Edit]:

It seems that the "something else" = "mouse delta movement"!

Is there any way to monitor and intercept\block "mouse delta movement"?

来源:https://stackoverflow.com/questions/59315105/setwindowshookex-issue-intercepting-blocking-mouse-movement-in-game

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!