AutoHotkey: Remap Keys and Key Macro

By Xah Lee. Date: .

Here are examples of simple key remap or set a key to send some keyboard shortcuts.

Note, for simple key remap, you should use Microsoft PowerToys, because it's easier to use and more reliable.

Right Win as App Key

; make the right Win key do AppsKey
RWin::AppsKey

[see AutoHotkey Key Syntax]

Single Key to Switch Previous Window

It is useful to have a single button to switch to last window.

; make Left Windows Key do switching to previous window
$LWin::Send !{Tab}

Single Key for Cut, Copy, Paste

$F2::Send ^x ; cut
$F3::Send ^c ; copy
$F4::Send ^v ; paste

Close Tab

; Pause/Break key close current tab
Pause::Send ^w

Switch to Previous/Next Tab

; F11 and F12 do switch prev/next tab
$F11::Send ^{PgUp}
$F12::Send ^{PgDn}