Skip to content

Instantly share code, notes, and snippets.

@ThomazPom
Last active October 3, 2024 16:49
Show Gist options
  • Save ThomazPom/ec7d0c41b70a72d7da042a9a4c844468 to your computer and use it in GitHub Desktop.
Save ThomazPom/ec7d0c41b70a72d7da042a9a4c844468 to your computer and use it in GitHub Desktop.

AHK Script: Remapping Insert Key

Purpose

This script globally disables the default behavior of the Insert key, as I never use it as intended. Instead, it remaps both the standard Insert key and the Numpad Insert key to function as Shift + Insert. This is useful when I mean to press Shift + Insert but mistakenly press only the Insert key.

Behavior

  • Numpad Insert: Remapped to act as Shift + Insert. Holding the Shift key allows multiple presses of the Insert key without releasing Shift.
  • Standard Insert: Also remapped to Shift + Insert for consistency.

Code

; Disable the default behavior of the Insert key globally.
; I never use the Insert key as intended, and I always mean to press Shift + Insert.
; Therefore, both NumpadIns and Insert keys will be remapped to send Shift + Insert instead.

; Remap Numpad Insert key to Shift + Insert.
NumpadIns::Send "+{Ins}" "{Shift down}" ; This sends Shift + Insert when the Numpad Insert is pressed.
                         ; Shift is held down while Insert is pressed.
                         ; Allows multiple Insert presses without releasing Shift.

; Remap standard Insert key to Shift + Insert.
Ins::Send "+{Ins}" ; Transforms the Insert key to act as Shift + Insert when pressed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment