Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- XButton2:: ; this means forward button. to change this button you have to change this line and 1 other
- if !MouseControl
- {
- CoordMode Mouse, Screen ; absolute coordinates
- SetMouseDelay -1 ; fastest action
- MouseGetPos x0, y0 ; get initial mouse pointer location
- SetTimer WatchMouse, 1 ; run the subroutine fast (10..16ms)
- MouseControl = 1
- }
- Return
- WatchMouse: ; this is a loop
- GetKeyState,XB2state,XButton2,P ;and this one
- if (XB2state = "U")
- {
- SetTimer WatchMouse, off
- MouseControl = 0
- }
- SetMouseDelay -1 ; fastest action Mouse gesture section
- CoordMode Mouse, Screen ; absolute coordinates
- MouseGetPos x, y ; get current mouse position
- Delta_x := abs(x-x0)
- Delta_y := abs(y-y0)
- if (Delta_x > Delta_y) { ; to prevent 'double inputs',
- if (x > x0)
- R := 1
- else R := 0
- if (x < x0)
- L := 1
- else L := 0
- }
- else {
- L := 0
- R := 0
- }
- if (Delta_y > Delta_x) {
- if (y > y0)
- D := 1
- else D := 0
- if (y < y0)
- U := 1
- else U := 0
- }
- else {
- D := 0
- U := 0
- }
- ;========================================= scrolling
- if (R && Delta_x > 1) { ; right
- send {WheelRight 1}
- }
- if (L && Delta_x > 1) { ; left
- send {WheelLeft 1}
- }
- if (D && Delta_y > 1) { ; down
- send {WheelDown 1}
- }
- if (U && Delta_y > 1) { ; up
- send {WheelUp 1}
- }
- MouseMove x0, y0, 0 ; set mouse to original location
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement