Skip to content

AutoHotKey macro -- Alt-Tab then press Caps Lock to move the off screen window back on screen

Notifications You must be signed in to change notification settings

Michaelangel007/caps_lock_move_offscreen_window

Repository files navigation

I got tired of Windows (TM) constantly moving my windows off screen when turning a monitor off. Here is an AutoHotKey script to move them back on screen so they are visible.

Executable only

  1. Download caps_lock_move_window_to_mouse.exe
  2. Double click on the caps_lock_move_window_to_mouse.exe file to run it.
  3. Use Alt-Tab to cycle to the window you want to move to your mouse.
  4. Press Caps Lock to move it.
  5. To exit the utility press Scroll Lock. (Note: On some keyboards you might need to press Fn.)

Compiling from Source

  1. Install AutoHotKey (*).
  1. Save the following as: caps_lock_move_window_to_mouse.ahk
SetTitleMatchMode, 2 
DetectHiddenWindows, On
CoordMode,Mouse,Screen

CapsLock::
    MouseGetPos, xpos, ypos
    WinMove, A,,xpos,ypos
    return

Scrolllock::
    ExitApp
  1. Double click on the .ahk file to run it.
  2. Use Alt-Tab to cycle to the window you want to move to your mouse.
  3. Press Caps Lock to move it.
  4. To exit the utility press Scroll Lock. (Note: On some keyboards you might need to press Fn.)

(*) (I placed a mirror in bin/ for convenience.)

Why is this utility even needed?

One can use the WindowsKey + Arrow Key to move a window to the edge the screen. Unfortunately, this does NOT work if the window is offscreen.

If you Shift+RightClick on the icon in the taskbar you get this menu:

  • system menu

Again, this does NOT work with certain program such as Discord.

Hence this utility.

About

AutoHotKey macro -- Alt-Tab then press Caps Lock to move the off screen window back on screen

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published