Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;HotkeyList v1.0.1
- ;List all hotkeys which were registered using HotKey API.
- ;
- ;https://pastebin.com/u/jcunews
- ;https://greasyfork.org/en/users/85671-jcunews
- ;https://www.reddit.com/u/jcunews1
- keys:= []
- loop 16 {
- mod:= a_index - 1
- ms:= ""
- if (mod & 8)
- ms:= ms . "Win + "
- if (mod & 4)
- ms:= ms . "Shift + "
- if (mod & 2)
- ms:= ms . "Ctrl + "
- if (mod & 1)
- ms:= ms . "Alt + "
- loop 255 {
- if (a_index == 0xE7) ;skip Packet VKey. it's used by the system
- continue
- vkey:= a_index
- res:= dllcall("RegisterHotKey", "ptr", 0, "int", 0, "uint", mod, "uint", vkey)
- if (res == 1) {
- dllcall("UnregisterHotKey", "ptr", 0, "int", 0)
- } else {
- v:= format("vk{:02X}", vkey)
- k:= getkeyname(v)
- if (strlen(k) == 1) {
- stringupper s, % k
- } else s:= k
- keys.push(ms . (s != "" ? s : v))
- }
- }
- }
- if (keys.length()) {
- s:= ""
- loop % keys.length() {
- s:= s . keys[a_index] . "`n"
- }
- filedelete %temp%\keys.txt
- fileappend %s%, %temp%\keys.txt
- run %temp%\keys.txt
- } else msgbox No hotkeys registered.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement