GetAsyncKeyState and special keys
I have created a C++ program in which GetAsyncKeyState function retrieves the keys with the line.
With the help of this program, I can recover the classical keys (0-9, a-z, ctrl, enter, space, etc ...), but I can not retrieve the keys "," ";" ":" "!" "^" ")" "=" and other special keys with this function.
For example for "," I tried VK_COMMA, but nothing is detected.
Can you help me to solve this problem?
Re: GetAsyncKeyState and special keys
Have you tried with VkKeyScanEx function? The VkKeyScanEx function translates a character to the corresponding virtual-key code and shift state. The function translates the character using the input language and physical keyboard layout identified by the input local identifier.
Syntax:
Code:
SHORT VkKeyScanEx(
TCHAR ch,
HKL dwhkl
);
where,
ch: Specifies the character to be translated into a virtual-key code.
dwhkl: Inputs local identifier used to translate the character. This parameter can be any input local identifier previously returned by the LoadKeyboardLayout function.
Re: GetAsyncKeyState and special keys
I tried it, but this function seems to only convert a character in his Scancode and does not allow me to identify in support of a key
Re: GetAsyncKeyState and special keys
No, but it allows you to get the Scancode you want to test. So, you just need to combine the two.