[SOLVED] Is there any way to disable a key on keyboard?

wabale97

Reputable
Oct 15, 2018
108
1
4,595
I want to disable some keys on the keyboard that I rarely use but hit accidentally from time to time.
(Also I want to disable backspace to force me to increase my typing accuracy)
 
Solution
Code:
; Script to block a few different keys.
; The backspace key also displays a message.

; The Alt key (both)
Alt::return

; The Win keys (right and left)
RWin::return
LWin::return

; The Backspace key
Backspace::MsgBox Stop making some many typos! Use the delete key if needed.

This script will change 3 keys:
  • Block Alt
  • Block Win
  • Backspace will show an annoying message.

All lines that begin with a semi-colon above are comments and can be removed.

More info about the "Keys" can be found on these 2 pages:
https://www.autohotkey.com/docs/Hotkeys.htm
https://www.autohotkey.com/docs/KeyList.htm

If you want to block Alt+Ctrl+A, you could use this code:
Code:
!^a::Return

Use Notepad to create the script...

gardenman

Splendid
Moderator
Code:
; Script to block a few different keys.
; The backspace key also displays a message.

; The Alt key (both)
Alt::return

; The Win keys (right and left)
RWin::return
LWin::return

; The Backspace key
Backspace::MsgBox Stop making some many typos! Use the delete key if needed.

This script will change 3 keys:
  • Block Alt
  • Block Win
  • Backspace will show an annoying message.

All lines that begin with a semi-colon above are comments and can be removed.

More info about the "Keys" can be found on these 2 pages:
https://www.autohotkey.com/docs/Hotkeys.htm
https://www.autohotkey.com/docs/KeyList.htm

If you want to block Alt+Ctrl+A, you could use this code:
Code:
!^a::Return

Use Notepad to create the script and save it with a .AHK extension like BlockKeys.ahk. Double click on the file to run it. AutoHotKey must be installed.

If it works, click on the little trophy beside of Grobes message above to show the thread has been answered.
 
Solution