Note that there are some explanatory texts on larger screens.

plurals
  1. POGlobal Mouse Hook + Simulate Mouse Inputs
    text
    copied!<p>I'm looking to create a global mouse hook that works in XP/Vista/7 which would allow me to access the X,Y values that the mouse is inputting, and modify those values before they hit Windows...</p> <p>I also want to be able to simulate mouse inputs in between actual mouse inputs...</p> <p>For example, lets say our inputs looked like this:</p> <p>1: 1,0 2: 2,0 3: 3,0 4: ?,?</p> <p>I want to be able to intercept input number 4 and run it through an 'if' statement: If the value of the input matches certain parameters, I want to modify the value by adding or subtracting from it...</p> <p>A USB Mouse has a default polling rate of 125Hz and a maximum of 1000hz... </p> <p>If possible (especially when the polling rate is set less than 1000hz) I would like to 'inject' inputs 'between' actual mouse updates (critical) so for example:</p> <p>(in milliseconds)</p> <p>0008 - 1,0 0016 - 1,0 0032 - 2,0</p> <p>So the mouse is updating at 125Hz... Could I detect the frequency of inputs, and send an input every other input??? So for example I could 'double' the mouse frequency from 125hz to 250hz, and simulate my own 'in between' updates based on whatever rules I set...</p> <p>Does any of these seem reasonable? Right now I am working in C# and I was working with the "Gma.UserActivityMonitor" from this tutorial here: <a href="http://www.codeproject.com/KB/cs/globalhook.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/cs/globalhook.aspx</a> but for some reason I get a performance hit which makes utilizing this code with fullscreen games have an unusable lag on the mouse inputs due to the hook... </p> <p>Perhaps I need to write something in C++? Any help would be greatly appreciated. Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload