Last active
October 31, 2022 23:45
-
-
Save andrew-1234/384ea4b716b4b0e8abb7012dbd600ae4 to your computer and use it in GitHub Desktop.
AHK script for adding various keyboard shortcuts to Raven Pro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Raven Shortcuts | |
;; https://github.com/andrew-1234 | |
;; Intro: | |
;; install AHK if you haven't already | |
;; save this script, make sure it has extension .ahk | |
;; double click to run the script. you should see it running in your task bar | |
;; icons | |
;; Usage note: this script works by moving your mouse to predefined positions, | |
;; clicking a button, and then returning your mouse. | |
;; i have tested this with raven 1.6.1, with the default window arrangement. | |
;; if the hotkeys do not work as expected, or click different things, or nothing, | |
;; then perhaps your window arrangement / arrangement of icons is different. | |
;; in this case, you will need to modify the X and Y settings in this file. | |
;; you can find those values using the Window Spy tool that comes with AHK | |
;; Customisation: | |
;; Change any of the hotkeys to whatever you like | |
;; E.g. F3:: in this script moves to next selection | |
;; If you change this to Right:: | |
;; Then the right arrow key would be used to move to next selection instead. | |
;; See the full keylist here: https://www.autohotkey.com/docs/KeyList.htm | |
;; If you do make changes to this script (using a text editor), then you will have to | |
;; save the script, and re-run it, before the change take effect. | |
;;============================================================================== | |
;; General script settings | |
#NoEnv | |
SendMode Input | |
SetWorkingDir %A_ScriptDir% | |
#SingleInstance, force | |
;;============================================================================== | |
;; Set the script to only work when Raven is active | |
;; these hotkeys will only work when a Raven Pro window is detected | |
SetTitleMatchMode, 2 | |
#IfWinActive, Raven Pro | |
;;============================================================================== | |
;; Zoom in and out of sound when holding down ctrl and using the scroll wheel | |
;; Specifying ctrl means you preserve ability to scroll the selection table | |
^WheelUp:: ;; Zoom in when pressing ctrl + wheel up. | |
;; the ^ means ctrl key, ^ plus mouse scroll = execute this action | |
Sleep, 5 | |
MouseGetPos, StartX, StartY ;; saves the current mouse position coordinates | |
CoordMode, Mouse, Window ;; use window mode setting, | |
; the x and y coordinates that are entered will be relative to the current | |
; working window (e.g. Raven) therefore if you resize raven or use different | |
; monitor size (laptop vs desktop), the script should still work | |
x := 299 | |
y := 101 | |
;; these are the x and y coordinates of the zoom in button in raven. if the | |
;; button is in a different position on your raven version, you can adjust these | |
;; coordinates using window spy which comes with AHK | |
Click %x% %Y% | |
Click %x% %Y% ;; I have mine set to click twice | |
MouseMove, StartX, StartY ;; this moves mouse back to starting position | |
return | |
^WheelDown:: ;; Zoom out | |
Sleep,5 | |
MouseGetPos, StartX, StartY | |
CoordMode, Mouse, Window | |
x := 326 | |
y := 102 | |
Click %x% %Y% | |
Click %x% %Y% | |
MouseMove, StartX, StartY | |
return | |
;;============================================================================== | |
;; Navigating through selections | |
F1:: ;; zoom to all | |
Sleep,100 | |
MouseGetPos, StartX, StartY | |
CoordMode, Mouse, Window | |
x := 271 | |
y := 102 | |
Click %x% %Y% | |
MouseMove, StartX, StartY | |
return | |
F2:: ;; zoom to selection | |
Sleep,100 | |
MouseGetPos, StartX, StartY | |
CoordMode, Mouse, Window | |
x := 244 | |
y := 102 | |
Click %x% %Y% | |
MouseMove, StartX, StartY | |
return | |
F3:: ;; activate next selection | |
Sleep,100 | |
MouseGetPos, StartX, StartY | |
CoordMode, Mouse, Window | |
x := 646 | |
y := 102 | |
Click %x% %Y% | |
MouseMove, StartX, StartY | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment