AutoHotkey logo

AutoHotKey has been featured on the site before, here and here and once its installed you need scripts to run it.  You can spend the time and write your own customised scripts or you can use scripts other experienced users have already written.

Featured here are three of the very many useful scripts to start you off. To run them on your own system either put the scripts in a .ahk file on your computer and run it manually or add it to your main .ahk file.  By default this is called AutoHotKey.ahk and is in the My Documents folder.  If you add them to your main file they all run together but it is highly recommended that you try them as separate files initially and when you are happy with them move them into your main file.

autohotkey screen

 

Spotify Global Controls

We’re big fans of Spotify but it can be inconvenient to change windows to change your music, particularly if you are in game. This script which works with the Spotify program (rather than the web interface) and allows you to control your music wherever you are without shifting to that window.

It maps previous, next, play/pause, volume up and down and mute.  It also allows you to copy the currently playing song’s name to the clipboard.  The default keys are:

  • Previous – Ctrl and Left
  • Next – Ctrl and Right
  • Play / Pause – Ctrl and Up
  • Volume up – Ctrl and PageUp
  • Volume down – Ctrl and PageDown
  • Mute – Ctrl End
  • Copy Song name to clipboard – Ctrl and Down

SetTitleMatchMode 2

; “CTRL + LEFT” for previous
^Left::
DetectHiddenWindows, On
ControlSend, ahk_parent, ^{Left}, ahk_class SpotifyMainWindow
DetectHiddenWindows, Off
return
; “CTRL + RIGHT” for next
^Right::
{
DetectHiddenWindows, On
ControlSend, ahk_parent, ^{Right}, ahk_class SpotifyMainWindow
DetectHiddenWindows, Off
return
}

; “CTRL + UP” for pause
^UP::
{
DetectHiddenWindows, On
ControlSend, ahk_parent, {space}, ahk_class SpotifyMainWindow
DetectHiddenWindows, Off
return
}

; “CTRL + DOWN” for info
^Down::
{
DetectHiddenWindows, On
SetTitleMatchMode 2
WinGetTitle, now_playing, ahk_class SpotifyMainWindow
StringTrimLeft, playing, now_playing, 10
DetectHiddenWindows, Off
clipboard = %playing%`r`n
return
}

; “CTRL + PAGE UP” for volume up
^PgUP::
{
DetectHiddenWindows, On
ControlSend, ahk_parent, ^{Up}, ahk_class SpotifyMainWindow
DetectHiddenWindows, Off
return
}

; “CTRL + PAGE DOWN” for volume down
^PgDn::
{
DetectHiddenWindows, On
ControlSend, ahk_parent, ^{Down}, ahk_class SpotifyMainWindow
DetectHiddenWindows, Off
return
}

; “CTRL + END” for mute
^End::
{
DetectHiddenWindows, On
ControlSend, ahk_parent, ^+{Down}, ahk_class SpotifyMainWindow
DetectHiddenWindows, Off
return
}

Link

 Caps Lock Autoclicker

There are numerous circumstances where you want to click repeatedly on something in a game or sometimes in Windows and this simple script does just that.  It starts left clicking  every 300ms when you put on the Caps lock and stops when you turn it off.

~capslock::
if getkeystate(“capslock”, “T”) ; checks if capslock is on or off
settimer, playmygame, 300 ; clicks every 300ms if capslock is on
else
settimer, playmygame, Off ; Turns off the autoclicking if capslock is off
return

playmygame:
SendInput, {Click} ; send a click.
Return

Link

2 Switch Computer Control

Finally this post has an amazing use of AutoHotKey for people with more extreme disability and mobility issues.

Designed for users with a physical disability having very limited mobility (Able to use 2 buttons/switches plugged into a modified mouse – e.g. with 1 switch next to each knee) but with mainstream level intelligence. Using this app a user can browse the internet at their leisure independently.

2 Button Screen 2 2 Button Screen

The script is far to0 long to post as is and it makes use of several graphics files so it is in the zip below.

2 switch computer control


Leave a Reply