A_PriorKey value convert to vk code

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Tvlao
Posts: 18
Joined: 29 Jun 2023, 03:39

A_PriorKey value convert to vk code

29 Jun 2023, 03:56

The script uses A_PriorKey to get the name of the previous key pressed, but it prints a letter, such as a dot . in the English layout, and ç in the Turkish layout. But i need to get the code of the pressed key (vk code), not the name, regardless of the layout.
That is, when you press dot, you should always get vkBE, not a dot or ç.
How would it be possible to convert ç value to vkBE code, or some other way?
User avatar
mikeyww
Posts: 27241
Joined: 09 Sep 2014, 18:38

Re: A_PriorKey value convert to vk code

29 Jun 2023, 05:10

Welcome to this AutoHotkey forum!

GetKeyVK()

Code: Select all

#Requires AutoHotkey v1.1.33
#InstallKeybdHook

F3::
priorVK := Format("vk{:X}", GetKeyVK(prior := A_PriorKey))
MsgBox 64, Prior key, % "Key = " prior "`n`n" priorVK
Return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], yxldh and 123 guests