Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Persistent
- SetTitleMatchMode, 2 ; Allow partial matches for window titles.
- DetectHiddenWindows, On
- CoordMode, Mouse, Screen
- Layer2 := false
- hotkey1::
- if (!Layer2) {
- Send, ^{[} ; Previous Page
- KeyWait, F8
- } else {
- Send, ^{[} ; Previous Page
- KeyWait, F8
- }
- Return
- hotkey2::
- if (!Layer2) {
- Send, ^{]} ; Next Page
- KeyWait, F9
- } else {
- Send, ^{]} ; Next Page
- KeyWait, F9
- }
- Return
- hotkey3::
- Layer2 := !Layer2 ; Layer Switch
- if (Layer2) {
- SetTimer, UpdateTooltip2, 50
- KeyWait, F10
- } else {
- SetTimer, UpdateTooltip2, Off
- SetTimer, UpdateTooltip1, 50
- KeyWait, F10
- SetTimer, RemoveTooltip, -1000
- }
- Send, {Esc} ; Escape the Application key menu
- Return
- UpdateTooltip2:
- if (Layer2) {
- MouseGetPos, MouseX, MouseY
- Tooltip, Layer 2 is active, MouseX + 15, MouseY + 15
- }
- Return
- UpdateTooltip1:
- MouseGetPos, MouseX, MouseY
- Tooltip, Layer 1 is active, MouseX + 15, MouseY + 15
- Return
- RemoveTooltip:
- SetTimer, UpdateTooltip1, Off
- Tooltip
- Return
- hotkey4::
- if (!Layer2) {
- Send, ^i ; Get Info Panel
- KeyWait, F11
- } else {
- Send, ^i ; Get Info Panel
- KeyWait, F11
- }
- Return
- hotkey5::
- if (!Layer2) {
- Return ; LAYER1 ACTION
- } else {
- Return ; LAYER2 ACTION
- }
- Return
- hotkey6::
- if (!Layer2) {
- Send, ^c ; Copy
- KeyWait, F13
- } else {
- Send, ^c ; Copy
- KeyWait, F13
- }
- Return
- hotkey7::
- if (!Layer2) {
- Send, ^{Right} ; Next Track
- KeyWait, F14
- } else {
- Send, {Home} ; Go to Top of List
- KeyWait, F14
- }
- Return
- hotkey8::
- if (!Layer2) {
- Send, ^x ; Cut
- KeyWait, F15
- } else {
- Send, ^x ; Cut
- KeyWait, F15
- }
- Return
- hotkey9::
- if (!Layer2) {
- Send, ^v ; Paste
- KeyWait, F16
- } else {
- Send, ^v ; Paste
- KeyWait, F16
- }
- Return
- hotkey10::
- if (!Layer2) {
- Send, ^+{Right} ; Next Chapter
- KeyWait, F17
- } else {
- Send, {PgUp} ; Scroll List Up by One Screenful
- KeyWait, F17
- }
- Return
- hotkey11::
- if (!Layer2) {
- Send, {Delete} ; Delete Selected Item
- KeyWait, F18
- } else {
- Send, {LAlt} ; Show Duplicates
- Sleep, 100
- Send, f
- Sleep, 100
- Send, b
- Sleep, 100
- Send, d
- Sleep, 10
- KeyWait, F18
- }
- Return
- hotkey12::
- if (!Layer2) {
- Send, {AppsKey}
- Sleep, 100
- Send, t ; Show Song in Playlist…
- Sleep, 10
- KeyWait, F19
- } else {
- Send, {AppsKey}
- Sleep, 100
- Send, b ; Show Song's in Album View
- Sleep, 10
- KeyWait, F19
- }
- Return
- hotkey13::
- if (!Layer2) {
- Send, ^+{Left} ; Previous Chapter
- KeyWait, F20
- } else {
- Send, {PgDn} ; Scroll List Down by One Screenful
- KeyWait, F20
- }
- Return
- hotkey14::
- if (!Layer2) {
- Send, {AppsKey}
- Sleep, 100
- Send, d ; Add Song to Playlist…
- Sleep, 10
- KeyWait, F21
- } else {
- Send, {LAlt} ; Hide Duplicates
- Sleep, 100
- Send, f
- Sleep, 100
- Send, b
- Sleep, 100
- Send, h
- Sleep, 10
- KeyWait, F21
- }
- Return
- hotkey15::
- if (!Layer2) {
- Send, {Enter}
- KeyWait, F22
- } else {
- Send, {Enter}
- KeyWait, F22
- }
- Return
- hotkey16::
- if (!Layer2) {
- Send, ^{Left} ; Previous Track
- KeyWait, F23
- } else {
- Send, {End} ; Go to Bottom of List
- KeyWait, F23
- }
- Return
- hotkey17::
- if (!Layer2) {
- Send, ^l ; Jump to Current Track
- KeyWait, F24
- } else {
- Send, ^l ; Jump to Current Track
- KeyWait, F24
- }
- Return
- ; Infinite scroll function
- #MaxHotkeysPerInterval 500
- #InstallKeybdHook
- #InstallMouseHook
- *WheelUp::Scroll(-1)
- *WheelDown::Scroll(1)
- Scroll(Direction) {
- static scrollCount := 0, level := 1, maxLevel := 15, timeout := 350, levelTickCount := 0
- , startingShiftState := 0, scrollingState := 0, flick := 0, wheelDir := ""
- if (level < maxLevel && ++scrollCount >= 4) { ; Change level when scrolling 4 times in a row, check for flick by detecting if it was scrolled 4 times within 60 ms.
- flick := (A_TickCount - levelTickCount < 60)
- levelTickCount := A_TickCount
- level++
- scrollCount := 1
- }
- wheelDir := (Direction = -1 ? "WheelUp" : "WheelDown")
- if (A_PriorHotkey = A_ThisHotkey && A_TimeSincePriorHotkey < timeout && level > 1) {
- Send, {Blind}{%wheelDir% %level%} ; Scroll faster when scrolling consecutively in a single direction.
- if (flick) {
- startingShiftState := GetKeyState("Shift", "P")
- scrollingState := 1
- SetTimer, AutoScroll, 30
- }
- } else {
- if (scrollingState)
- scrollingState := 0
- else
- Send, {Blind}{%wheelDir%}
- level := 1
- }
- return
- AutoScroll:
- if (level = 1 ; Stop auto-scroll if…
- || GetKeyState("Shift", "P") != startingShiftState
- || !scrollingState
- || A_PriorHotKey != A_ThisHotkey) {
- scrollingState := 0
- SetTimer, AutoScroll, Off
- } else {
- Send, {Blind}{%wheelDir% %level%}
- }
- return
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement