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 given keyboard layout handle.
SHORT VkKeyScanEx(
CHAR ch, |
// character to translate |
HKL dwhkl |
// keyboard layout handle |
); |
If the function succeeds, the low-order byte of the return value contains the virtual-key code and the high-order byte contains the shift state, which can be a combination of the following flag bits:
Bit |
Meaning |
1 |
Either SHIFT key is pressed. |
2 |
Either CTRL key is pressed. |
4 |
Either ALT key is pressed. |
8 |
The Hankaku key is pressed |
16 |
Reserved (defined by the keyboard layout driver). |
32 |
Reserved (defined by the keyboard layout driver). |
If the function finds no key that translates to the passed character code, both the low-order and high-order bytes contain -1.
For keyboard layouts that use the right-hand ALT key as a shift key (for example, the French keyboard layout), the shift state is represented by the value 6, because the right-hand Alt key is converted internally into CTRL+ALT.
Translations for the numeric keypad (VK_NUMPAD0 through VK_DIVIDE) are ignored. This function is intended to translate characters into keystrokes from the main keyboard section only. For example, the character “7” is translated into VK_7, not VK_NUMPAD7.
VkKeyScanEx is used by applications that send characters by using the WM_KEYUP and WM_KEYDOWN messages.
GetAsyncKeyState, GetKeyboardState, GetKeyNameText, GetKeyState, LoadKeyboardLayout, SetKeyboardState, ToAsciiEx, VkKeyScan
file: /Techref/os/win/api/win32/func/src/f90_19.htm, 4KB, , updated: 2000/4/7 12:19, local time: 2024/9/1 16:25,
3.12.160.97:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://piclist.com/techref/os/win/api/win32/func/src/f90_19.htm"> VkKeyScanEx</A> |
Did you find what you needed? |
![]() o List host: MIT, Site host massmind.org, Top posters @none found - Page Editors: James Newton, David Cary, and YOU! * Roman Black of Black Robotics donates from sales of Linistep stepper controller kits. * Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters. * Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
Ashley Roll has put together a really nice little unit here. Leave off the MAX232 and keep these handy for the few times you need true RS232! |
.