Last active
July 3, 2024 14:55
-
-
Save anonymous1184/da81e29517b0ba6dd552f7c6439be032 to your computer and use it in GitHub Desktop.
Virtual/Scan Codes & Key Names
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Version: 2022.07.01.1 | |
; https://gist.github.com/da81e29517b0ba6dd552f7c6439be032 | |
/* Virtual/Scan Codes & Key Names | |
Uses a keyboard hook to provide all information of a key pressed. | |
The idea of the Gui is from SKAN, however his script fails to detect some keys and other info | |
https://autohotkey.com/board/topic/21105-crazy-scripting-scriptlet-to-find-scancode-of-a-key/ | |
*/ | |
#NoTrayIcon | |
#SingleInstance force | |
hook := InputHook() | |
hook.KeyOpt("{All}", "NS") | |
hook.OnKeyDown := Func("KeyDown") | |
hook.Start() | |
Gui New, ToolWindow AlwaysOnTop | |
Gui Font, Bold q5 s14, Consolas | |
Gui Add, Text, 0x201 +Border w160 h33, {vk00} {sc000} | |
Gui Show,, > Key Information Discovery | |
return ; End of auto-execute | |
KeyDown(Hook, vk, sc) { | |
vkCode := Format("vk{:02X}", vk) | |
scCode := Format("sc{:03X}", sc) | |
ToolTip % "Key name: " GetKeyName(vkCode), 2, 80 | |
GuiControl Text, Static1, % "{" vkCode "} {" scCode "}" | |
} | |
GuiClose: | |
ExitApp | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment