#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. CoordMode, Mouse, Window ; makes mouse coordinates relative to the active window #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.6 portable\MuseScorePortable\App\MuseScore\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 hotkey / + C 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 COORDINATES ========================= SetTimer, ShowCoordinates, 0 ; "0" updates position instantly Return ShowCoordinates: ; label of SetTimer if !GetKeyState("CapsLock", "T") ; whether capslock is on or off { ToolTip, , , , 1 ; if off, don't show tooltip (1) 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 ; (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 ~/ & c:: Clipboard = %xx% %yy% ; store coordinates in clipboard Return } Return ~] & /:: MsgBox, 4132, PixelMousing, Are you sure you want to exit? IfMsgBox, Yes ExitApp Return ; ================================= PIXELMOUSING ======================================== ; speed: 100 is slowest, 0 is instantly ; R = movement relative to mouseposition ; Numpad keys: NumLock must be on ~>^/:: ; when you press Right Control + / MouseMove, 100, 0, 0, R ; the mouse will move right 100 pixels instantly Return ~<^/:: ; when you press Left Control + / MouseMove, -100, 0, 0, R ; the mouse will move left 100 pixels instantly Return ~!/:: ; when you press Right Alt + / MouseMove, 0, -100, 0, R ; the mouse will move up 100 pixels instantly Return ~NumpadEnter & Numpad8:: ; when you press NumpadEnter + Numpad 8 (up) or ~/ & u:: ; when you press / + u MouseMove, 0, -25, 100, R ; the mouse will move up 25 pixels Return ~NumpadEnter & Numpad2:: ; when you press NumpadEnter + Numpad 2 (down) or ~/ & d:: ; when you press / + d MouseMove, 0, 25, 100, R ; the mouse will move down 25 pixels Return ~NumpadEnter & Numpad4:: ; when you press NumpadEnter + Numpad 4 (left) or ~/ & l:: ; when you press / + l MouseMove, -25, 0, 100, R ; the mouse will move left 25 pixels Return ~NumpadEnter & Numpad6:: ; when you press NumpadEnter + Numpad 6 (right) or ~/ & r:: ; when you press / + r MouseMove, 25, 0, 100, R ; the mouse will move right 25 pixels Return ~NumpadEnter & Numpad1:: ; when you press NumpadEnter + Numpad 1 or ~/ & Left:: ; when you press / + left MouseMove, -1, 0, 100, R ; the mouse will move left 1 px Return ~NumpadEnter & Numpad3:: ; when you press NumpadEnter + Numpad 3 or ~/ & Right:: ; when you press / + right MouseMove, 1, 0, 100, R ; the mouse will move right 1 px Return ~NumpadEnter & Numpad5:: ; when you press NumpadEnter + Numpad 5 or ~/ & Up:: ; when you press / + up MouseMove, 0, -1, 100, R ; the mouse will move up 1 px Return ~NumpadEnter & NumpadDot:: ; when you press NumpadEnter + Numpad . or ~NumpadEnter & Numpad0:: ; when you press NumpadEnter + Numpad 0 or ~/ & Down:: ; when you press / + down MouseMove, 0, 1, 100, R ; the mouse will move down 1 px Return ~/ & ,:: ; when you press / + comma Send {Click} ; the mouse will left click Return ~/ & .:: ; when you press / + . Send {Click, right} ; the mouse will right click Return ~NumpadEnter & Numpad7:: ; when you press NumpadEnter + Numpad 7 or ~/ & n:: ; when you press / + n SendEvent {Click, down} ; click and hold down Sleep, 1000 ; give Window Image capturing tool time to disappear MouseGetPos, TLC_X, TLC_Y ; TopLeftCorner Return ; drag enable ~NumpadEnter & Numpad9:: ; when you press NumpadEnter + Numpad 9 or ~/ & m:: ; when you press / + m MouseGetPos, BRC_X, BRC_Y ; BottomRightCorner SendEvent {Click, up} ; releases the mouse button Return ; drag disable ~NumpadEnter & NumpadDiv:: MouseGetPos, TLC_X, TLC_Y ; TopLeftCorner Return ~NumpadEnter & NumpadMult:: MouseGetPos, BRC_X, BRC_Y ; BottomRightCorner Return ~/ & i:: ; Image coordinates to clipboard Clipboard := "" ; empty the clipboard Clipboard = TLC_X = %TLC_X%%A_Space%%A_Space%%A_Space%TLC_Y = %TLC_Y%`nBRC_X = %BRC_X%%A_Space%%A_Space%%A_Space%BRC_Y = %BRC_Y% ; ToolTip, TLC: X1 = %TLC_X% Y1 = %TLC_Y%`nBRC: X2 = %BRC_X% Y2 = %BRC_Y%`nPress Z., A_ScreenWidth/2, 40, 2 ; KeyWait, z, d ; ToolTip, , , , 2 ; close tooltip (2) SetTitleMatchMode, 2 If WinExist("Image_Coordinates") Goto, SkipRunIC Run, Image_Coordinates.txt, , Min ; start minimized Sleep, 500 SkipRunIC: WinActivate, Image_Coordinates WinGetPos, , , Width, Height, Image_Coordinates WinMove, Image_Coordinates, , (A_ScreenWidth/2)-(Width/2), (A_ScreenHeight/2)-(Height/2), 800, 800 ; 800, 800 size of text window (*change*?) Return ; ====================================== HELP =========================================== ~/ & h:: ; open help info MsgBox, 4096, PixelMousing - This info opens with / + H, ( All coordinates are relative to the active window Show/hide coordinates CapsLock Copy coordinates hotspot / + C Copy coordinates surface / + I Paste coordinates in text Control + V Move the mouse: 1 px slow Up / + Up NumpadEnter + Num5 Down / + Down NumpadEnter + Num0 or Num. Left / + Left NumpadEnter + Num1 Right / + Right NumpadEnter + Num3 Move the mouse: 25 px slow Up / + U NumpadEnter + Num8 Down / + D NumpadEnter + Num2 Left / + L NumpadEnter + Num4 Right / + R NumpadEnter + Num6 Move the mouse: 100 px fast Up Right Alt + / Down Left Alt + / Left Left Control + / Right Right Control + / Left Click / + , Right Click / + . TLC-Drag enable / + N NumpadEnter + Num7 BRC-Drag disable / + M NumpadEnter + Num9 Copy coordinates / + I TLC and BRC Without drag en/disable Get TLC NumpadEnter + Numpad / (Division) Get BRC NumpadEnter + Numpad * (Multiplication) After / + I the file Image_Coordinates.txt appears. Here you can paste the four surface coordinates with Control + V TopLeftCorner TLC and BottomRightCorner BRC of an Image Load PM * [ + / Exit PM ] + / * Master must be active Related: Run SnippingTool [ + NumpadAdd ) Return ; ============================ ACKNOWLEDGMENTS ======================================== ; acknowledgments: Chris Mallett, Lexikos, the AutoIt team, developers, contributors ; to the very active community around AutoHotKey