Quantcast
Channel: How To's | Everything Tech - Appuals.com
Viewing all articles
Browse latest Browse all 4542

How to Use AutoHotKey to Snap Application to Side Of the Screen

$
0
0

AutoHotKey, often abbreviated to AHK, is a popular and open-source scripting language for Windows. It’s designed to make it easy to change keyboard shortcuts – or hotkeys – so that they suit your specific needs. It’s also used for software automations, and can be used by people new to coding.

A SuperUser.com user explained that, in an effort to make the ctrl+shift+arrow command result in applications snapping to one side of the screen, that the command would only work on occasion. The user used the following script:

^+Right::send, #{Right down}{Right up}

^+Left::send, #{Left down}{Left up}

While the script showed limited success, it is possible to refine the script and use AutoHotKey to make it a reliable shortcut. Below is an explanation of how you can do that.

Amend Script & Install AutoHotKey

  1. To start, you will need to download AutoHotKey from this link. During the AutoHoteKey installation, you will be asked to choose between ANSI and UNICODE. Choosing UNICODE will mean that the software supports non-English characters. Follow the on-screen instructions until there is an Install Click it and continue.
  2. Once the software has installed, you should be able to create scripts from your On your Desktop, right click and highlight New. From the drop-down menu, choose AutoHotKey Script.
  3. Choose a name for your script. As you are using it to create a ‘Snap’ function, you could perhaps call it KeyboardSnapShortcut.ahk. The .ahk file extension is necessary.
  4. A new icon should appear on your Desktop called Right click the icon and then choose Edit Script. A Notepad window should appear. This will contain your script. In Notepad, amend the following script:^+Right::send, #{Right down}{Right up}

          ^+Left::send, #{Left down}{Left up}

With:

^+Right:: SendEvent {LWin down}{Right down}{LWin up}{Right up}

OR

^+Right:: Send {LWin down}{Right}{LWin up}

  1. Now, use the ctrl+S command on your keyboard to save your script, and exit the window.
  2. Double click the icon on your home screen and the code will run. Now, you should be able to snap windows to the left or right of your screen using the ctrl+shift+left arrow / right arrow.

The post How to Use AutoHotKey to Snap Application to Side Of the Screen appeared first on Appuals.com.


Viewing all articles
Browse latest Browse all 4542

Trending Articles