#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #SingleInstance force ; Only one instance of script can run. Restart replaces script (Reloads). #Persistent ; To make it run indefinitely #IfWinActive ahk_exe S:\MuseScore 3.4\bin\MuseScore3.exe ; Enables Hotkeys when MuseScore3 Window is Active ; Replace the path S:\etc. with your location of MuseScore3.exe /* Everything between /* and */ is outcommented. Don't put anything else on the same line. Single lines can be outcommented by putting a semicolon followed by a space at the start of the line. Outcommented parts are not read by the app, so don't influence the speed of execution. PixelMousing displays the mouse coordinates and copies them (to clipboard) with the PrintScreen button if needed. While CapsLock is toggled On: The script will display the coordinates of the Mouse Position as a tooltip halfway at the top (1) or at the top-left corner of the screen (2). */ ; ======================== CAPSLOCK TOGGLE and COPY FUNCTION ========================== SetTimer, ShowCoordinates, 0 ; "0" updates position instantly Return ShowCoordinates: ; label of SetTimer if !GetKeyState("CapsLock", "T") ; whether capslock is on or off { ToolTip ; if off, don't show tooltip at all } else { ; if on CoordMode, ToolTip, Screen ; makes tooltip to appear at position relative to screen CoordMode, Mouse, Window ; makes mouse coordinates to be relative to active window MouseGetPos, xx, yy ; get mouse x and y position, store as %xx% and %yy% ToolTip, %xx% %yy%, A_ScreenWidth/2, 0 ; (1) display tooltip of %xx% %yy% halfway top of screen ; ToolTip, %xx% %yy%, 0, 0 ; (2) display tooltip of %xx% %yy% at coordinates x0 y0 PrintScreen:: ; assign function to PrintScreen only if pressed Clipboard == %xx% %yy% ; store %xx% %yy% to clipboard. Return ; equal (=), case-sensitive-equal (==) } ; these are expression operators Return ; ============================= PIXELMOUSING ========================================== ; hotkeys consisting of only one line may be written without 'Return'. ; R = movement relative to mouseposition SetDefaultMouseSpeed, 0 ; sets the delay of mouse speed to instant CoordMode, Mouse, Window ; makes mouse coordinates relative to the active window ~/ & u::MouseMove, 0, -25, 100, R ; when you press u, mouse will move up 25 pixels ~/ & d::MouseMove, 0, 25, 100, R ; when you press d, mouse will move down 25 pixels ~/ & Left::MouseMove, -1, 0, 100, R ; left 1 px ~/ & Right::MouseMove, 1, 0, 100, R ; right 1 px ~/ & Up::MouseMove, 0, -1, 100, R ; up 1 px ~/ & Down::MouseMove, 0, 1, 100, R ; down 1 px ~/ & l::MouseMove, -25, 0, 100, R ; when you press l, mouse will move left 25 pixels ~/ & r::MouseMove, 25, 0, 100, R ; when you press r, mouse will move right 25 pixels ~/ & ,::Send {Click} ; when you press ', mouse will left click ~/ & .::Send {Click, right} ; when you press \, mouse will right click ~/ & n:: CoordMode, Mouse, Window ; drag enable Click, D ; click and hold down Return ~/ & m:: ; drag disable CoordMode, Mouse, Window Click, U ; releases the mouse button Return ; ============================== HELP and EXIT ======================================== ~/ & h:: MsgBox, 4096, PixelMousing - This info opens with / + H, ( All coordinates are relative to the active window Show/hide coordinates CapsLock Copy coordinates to clipboard PrintScreen Move the mouse: Up 1 px / + Up Down 1 px / + Down Left 1 px / + Left Right 1 px / + Right Up 25 px / + U Down 25 px / + D Left 25 px / + L Right 25 px / + R Drag enable / + N Drag disable / + M Left Click / + , Right Click / + . Exit PixelMousing / + Q ) Return ~/ & q:: MsgBox, 4132, PixelMousing, Are you sure you want to exit? IfMsgBox, Yes ExitApp Return ; ============================ ACKNOWLEDGMENTS ======================================== ; acknowledgments: Chris Mallett, the AutoIt team, developers, contributors ; and the very active community around AutoHotKey ; https://www.autohotkey.com/docs/misc/Acknowledgements.htm ; Display mouse coordinates and copy them if needed - by demented ; https://autohotkey.com/board/topic/80205-display-mouse-coordinates-and-copy-them-if-needed/ ; Turn keyboard into mouse by 7usabball ; https://autohotkey.com/board/topic/37947-turn-keyboard-into-mouse/ ; with some additions by MichLeon