网站首页  词典首页

请输入您要查询的函数:

 

术语 toasciiex
释义 ToAsciiEx
语法:
int ToAsciiEx( UINT uVirtKey,
UINT uScanCode,
PBYTE lpKeyState,
LPWORD lpChar,
UINT uFlags,
HKL dwhkl
);
ToAsciiEx功能
该ToAsciiEx功能转换指定的虚拟键码和键盘状态,相应的字符或字符。转换函数使用的代码输入语言和身体的键盘布局输入法区域设置标识符确定。
参数
uVirtKey
[in]指定虚拟键码翻译。
uScanCode
[in]指定的硬件扫描的关键代码进行翻译。的高序位这个值,如果设置的关键是建立(未按)。
lpKeyState
[in]指向1 256字节数组,包含当前的键盘状态。每个元素(字节数组)包含一个国家重点。如果高字节序位被设置,关键是下(按下)。
低位,如果设置,指出关键是切换的。在此函数中,只有CAPS LOCK键切换位是相关的。该NUM LOCK和SCROLL LOCK键键切换状态被忽略。
lpChar
[out]指向的缓冲区,它接收翻译字符或字符。
uFlags
[in]指定菜单是否处于活动状态。此参数必须是1,如果一个菜单处于活动状态,否则为0。
dwhkl
[in]输入区域设置标识符用来翻译代码。此参数可以是任何输入区域设置标识符先前LoadKeyboardLayout函数返回。
返回值
如果指定的键是一条走不通的关键,则返回值为负。否则,它是下列值之一。
ValueMeaning
0The指定的虚拟键并没有为键盘的当前状态的翻译。
1One字符复制到缓冲区。
2Two字符复制到缓冲区。这通常是一死,关键字符(口音或读音符号)中存储的键盘布局,不能与指定虚拟键组成,形成一个单独的字符。
备注
输入法区域设置标识符是一个比键盘布局更广泛的概念,因为它也可以包括演讲到文本转换器,输入法编辑器(IME),或任何其他形式的投入。
提供给ToAsciiEx函数的参数可能不足以翻译的虚拟键码,因为以前死亡的关键是在键盘布局中。
通常情况下,ToAsciiEx执行的虚拟键代码的翻译。在某些情况下,不过,位的uScanCode参数15可以用来区分一个按键和一个按键释放。扫描代码用于转换ALT键+数字键的组合。
NUM LOCK键,虽然是一个切换键,键盘行为的影响,ToAsciiEx忽略切换设置(低位lpKeyState(VK_NUMLOCK)),因为uVirtKey参数本身就足以区分光标移动键(VK_HOME,VK_INSERT等)由在(VK_DECIMAL,VK_NUMPAD0 - VK_NUMPAD9)数字键。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 4.0
UnicodeImplemented为Unicode版本。
参见
键盘输入,LoadKeyboardLayout,扫描码,ToUnicodeEx,VkKeyScan
==英文原文==ToAsciiEx Function
The ToAsciiEx function translates the specified virtual-key code and keyboard state to the corresponding character or characters. The function translates the code using the input language and physical keyboard layout identified by the input locale identifier.
Syntax
int ToAsciiEx( UINT uVirtKey,
UINT uScanCode,
PBYTE lpKeyState,
LPWORD lpChar,
UINT uFlags,
HKL dwhkl
);
Parameters
uVirtKey
[in] Specifies the virtual-key code to be translated.
uScanCode
[in] Specifies the hardware scan code of the key to be translated. The high-order bit of this value is set if the key is up (not pressed).
lpKeyState
[in] Pointer to a 256-byte array that contains the current keyboard state. Each element (byte) in the array contains the state of one key. If the high-order bit of a byte is set, the key is down (pressed).
The low bit, if set, indicates that the key is toggled on. In this function, only the toggle bit of the CAPS LOCK key is relevant. The toggle state of the NUM LOCK and SCOLL LOCK keys is ignored.
lpChar
[out] Pointer to the buffer that receives the translated character or characters.
uFlags
[in] Specifies whether a menu is active. This parameter must be 1 if a menu is active, zero otherwise.
dwhkl
[in] Input locale identifier to use to translate the code. This parameter can be any input locale identifier previously returned by the LoadKeyboardLayout function.
Return Value
If the specified key is a dead key, the return value is negative. Otherwise, it is one of the following values.
ValueMeaning
0The specified virtual key has no translation for the current state of the keyboard.
1One character was copied to the buffer.
2Two characters were copied to the buffer. This usually happens when a dead-key character (accent or diacritic) stored in the keyboard layout cannot be composed with the specified virtual key to form a single character.
Remarks
The input locale identifier is a broader concept than a keyboard layout, since it can also encompass a speech-to-text converter, an Input Method Editor (IME), or any other form of input.
The parameters supplied to the ToAsciiEx function might not be sufficient to translate the virtual-key code, because a previous dead key is stored in the keyboard layout.
Typically, ToAsciiEx performs the translation based on the virtual-key code. In some cases, however, bit 15 of the uScanCode parameter may be used to distinguish between a key press and a key release. The scan code is used for translating ALT+number key combinations.
Although NUM LOCK is a toggle key that affects keyboard behavior, ToAsciiEx ignores the toggle setting (the low bit) of lpKeyState (VK_NUMLOCK) because the uVirtKey parameter alone is sufficient to distinguish the cursor movement keys (VK_HOME, VK_INSERT, and so on) from the numeric keys (VK_DECIMAL, VK_NUMPAD0 - VK_NUMPAD9).
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 4.0
UnicodeImplemented as Unicode version.
See Also
Keyboard Input , LoadKeyboardLayout , MapVirtualKeyEx , ToUnicodeEx , VkKeyScan
==原始网址==http://msdn.microsoft.com/en-us/library/ms646318(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:25:50