Skip to main content

History: Miyagi SetMousePosition

Source of version: 3 (current)

Copy to clipboard
            Following code allows you to set mouse coordinates to a given (x,y).

{CODE(wrap="1", colors="c#")}private void SetMousePosition(int x, int y)
{
   MOIS.MouseState_NativePtr msnp = this.inputMouse.MouseState;

   MOIS.Axis_NativePtr anp = msnp.X;
   anp.abs = x;
           
   anp = msnp.Y;
   anp.abs = y;
           
   GuiManager.Singleton.InputManager.InjectMouseMoved(x, y, false);
}{CODE}