Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mouse movement limiter
#1
Is it possible to set up a macro that will limit where the mouse is allowed to move?

What I am looking for is something where I could press a key and the mouse cursor would be stuck in a 150x150 pixel area or so in the center of the screen. If you tried to move it outside that area, the mouse would stop as is you were trying to move the mouse beyond the limit of your own display. Being able to disable this macro with the same key that activated it (toggling it on and off) is ideal, but not essential.
#2
Macro Macro1521
Code:
Copy      Help
RECT r

int width(150) height(150) ;;change these values
r.right=ScreenWidth; r.bottom=ScreenHeight
InflateRect &r -r.right/2+(width/2) -r.bottom/2+(height/2)

;the above code calculates rectangle of specified width/height in screen center. Alternatively use code like this:
;r.left=100
;r.top=100
;r.right=r.left+150
;r.bottom=r.top+150

;_____________________________

RECT rr
if(GetClipCursor(&rr) and !memcmp(&r &rr sizeof(r))) ClipCursor 0
else ClipCursor &r

This macro sets or resets mouse cursor clipping.
Activating a window of other process also resets clipping.


Forum Jump:


Users browsing this thread: 1 Guest(s)