Skip to content

Commit

Permalink
Update AHK-GlobalGestures.ahk
Browse files Browse the repository at this point in the history
Squished more bugs
  • Loading branch information
CheeseFrog authored Jan 8, 2020
1 parent 7a208c2 commit c285496
Showing 1 changed file with 51 additions and 47 deletions.
98 changes: 51 additions & 47 deletions AHK-GlobalGestures.ahk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; AHK-GlobalGestures v1.17 - https://github.com/CheeseFrog/AHK-GlobalGestures
; AHK-GlobalGestures v1.18 - https://github.com/CheeseFrog/AHK-GlobalGestures


#NoEnv
Expand Down Expand Up @@ -52,9 +52,9 @@ If ((Abs(x2-x1)>A_ScreenWidth*.55) or (Abs(y2-y1)>A_ScreenHeight*.55)) ; long-dr
Case 2:
Send ^{PgUp} ; tab left
Case 3:
Send {Home} ; ^{Up} ; scroll home
Send {Home} ; scroll home
Case 4:
Send {End} ; ^{Down} ; stroll end
Send {End} ; stroll end
Default:
Return -1
}
Expand All @@ -74,6 +74,54 @@ Else
}


RandM(x1, y1) {
global
while GetKeyState("RButton", "P")
If GetKeyState("MButton", "P") and noRclick {
Send {Ctrl down}{0}{Ctrl up} ; reset zoom
KeyWait, MButton, U
}
KeyWait, MButton, U
If noR()
Exit
MouseGetPos, x2, y2
Switch RLUD(x1, y1, x2, y2) {
Case 1:
Send {Media_Next} ; next track
Case 2:
Send {Media_Prev} ; previous track
Case 3:
Send {Media_Stop} ; stop
Case 4:
Send {Media_Play_Pause} ; pause / play
Default:
Send {Ctrl down}{0}{Ctrl up} ; reset zoom
}
}


wheel(D) {
global
If GetKeyState("LButton", "P") {
If RL {
noRclick:=1
If (D)
Send {Volume_Down} ; volume down
Else
Send {Volume_Up} ; volume up
}
Exit
}
noRclick:=1
If (D)
Send {Ctrl down}{WheelDown} ; zoom out
Else
Send {Ctrl down}{WheelUp} ; zoom in
sleep 5
Send {Ctrl up}
}


RandL(x1, y1, t1) { ; global rocker gestures
global
while GetKeyState("RButton", "P")
Expand Down Expand Up @@ -138,51 +186,7 @@ Click, up, right
Return


RandM(x1, y1) {
MouseGetPos, x1, y1 ; debugs post-zoom media gesture
KeyWait, MButton, U
noR()
MouseGetPos, x2, y2
Switch RLUD(x1, y1, x2, y2) {
Case 1:
Send {Media_Next} ; next track
Case 2:
Send {Media_Prev} ; previous track
Case 3:
Send {Media_Stop} ; stop
Case 4:
Send {Media_Play_Pause} ; pause / play
Default:
Send {Ctrl down}{0}{Ctrl up} ; reset zoom
}
}


~Rbutton & MButton::Return ; prevent M-click
~RButton & LButton::RL:=1


wheel(D) {
global
If GetKeyState("LButton", "P") {
If RL {
noRclick:=1
If (D)
Send {Volume_Down} ; volume down
Else
Send {Volume_Up} ; volume up
}
Exit
}
noRclick:=1
If (D)
Send {Ctrl down}{WheelDown} ; zoom out
Else
Send {Ctrl down}{WheelUp} ; zoom in
sleep 5
Send {Ctrl up}
}


~Rbutton & WheelUp::wheel(0)
~Rbutton & WheelDown::wheel(1)

0 comments on commit c285496

Please sign in to comment.