Move mouse pointer with a keystroke

I sometimes find myself having to stop typing to move the mouse to avoid triggering tooltips that are active where I last left my mouse pointer, usually in the segment status column:

Trados Studio tooltip showing Translation Details with Status: Not Translated, Origin, and Score 0%.

The script below uses the Insert key to move the mouse pointer out of the way, to a position where it does no harm while I'm typing:

Insert:: ;move mouse pointer out of the way
MouseMove, 1300, 8 ;use your own coordinates here
return

And this one brings the mouse pointer back to the cursor position by pressing the Insert and Home keys:

Insert & Home:: ;move mouse pointer to cursor position
MouseMove, % A_CaretX, % A_CaretY
return

 

 



Generated Image Alt-Text
[edited by: Trados AI at 4:06 AM (GMT 0) on 5 Mar 2024]
emoji
Parents Reply Children
  • Hi Keenan,

    Glad to hear I'm not alone! To use these scripts, and any other scripts offered here in the AutoHotkey forum, do the following:

    1. Download and install AutoHotkey (). Once installed, nothing seems to happen, no program opens or anything, but don't worry about that.

    2. Find or create a folder where you want to store your scripts. In that folder, right-click and select New-AutoHotkey Script. Name this file, for instance "Move mouse pointer". The extension will be .ahk.

    3. Open the file you just created in a text editor, such as Notepad (I like Notepad++) and paste the following lines of code below the text that's already included in the file:

     

    #IfWinActive ahk_exe SDLTradosStudio.exe

     

    Insert:: ;move mouse pointer out of the way

    MouseMove, 1300, 8 ;use your own coordinates here, this is based on a 27" screen

    return

     

    Insert & Home:: ;move mouse pointer to cursor position

    MouseMove, % A_CaretX, % A_CaretY

    return

    4. Save the file and double-click it to activate the script.

    And that's it, now try it by going to Studio, placing your mouse anywhere and then hitting the Insert key. Doing so should move the mouse to the top of the screen.

    Note: Depending on your screen size and where you want to place your mouse pointer, you may need to modify the coordinates in the script. To find the right coordinates, use Window Spy, a utility that comes with AutoHotkey (you can launch it by typing Window Spy in the Windows search window or you can find it here: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\AutoHotkey).

    With Studio open, launch Window Spy and click in the location where you'd like to place your mouse. You'll see the coordinates listed in the area shown below (I used the recommended coordinates when creating my script):

    Active Window Info tool showing mouse position coordinates with Absolute: 1310, 8 and Relative: 1318, 8 in SDL Trados Studio application.

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 4:07 AM (GMT 0) on 5 Mar 2024]