网站首页  词典首页

请输入您要查询的函数:

 

术语 mapvirtualkey
释义 MapVirtualKey
语法:
UINT MapVirtualKey( UINT uCode,
UINT uMapType
);
MapVirtualKey函数
该MapVirtualKey函数转换成扫描码或字符值,或扫描转换成虚拟键码代码(地图)一个虚拟键码。
要指定一个句柄的键盘布局翻译使用指定的代码,使用扫描码功能。
参数
的UCODE
[in]指定虚拟键码或扫描代码的关键。如何解释此值取决于对uMapType参数的值。
uMapType
[in]指定的翻译来执行。这个参数的值取决于的UCODE参数的值。
MAPVK_VK_TO_VSC
的UCODE是一个虚拟键码,并成为一个扫描码翻译。如果它是一个虚拟键码,不区分左,右手键,左边的扫描码返回。如果没有翻译,则函数返回0。
MAPVK_VSC_TO_VK
的UCODE是一个扫描码,并成为一个虚拟键码,不区分左,右手键翻译。如果没有翻译,则函数返回0。
MAPVK_VK_TO_CHAR
的UCODE是一个虚拟键码,并逐渐成为低返回值的顺序单词unshifted字符值的翻译。死键(变音符号)的说明通过设置返回值的最高位。如果没有翻译,则函数返回0。
MAPVK_VSC_TO_VK_EX
Windows NT/2000/XP的:的UCODE是一个扫描码,并成为一个虚拟键码之间左,右手键区分开来翻译。若没有翻译,则函数返回0。
MAPVK_VK_TO_VSC_EX
返回值
返回值可以是一个扫描码,一个虚拟键码,或一个字符值,取决于的UCODE和uMapType价值。如果没有翻译,返回值是零。
备注
应用程序可以使用MapVirtualKey翻译扫描码的虚拟键码常数VK_SHIFT,VK_CONTROL,和VK_MENU,反之亦然。这些翻译不区分的SHIFT键,Ctrl或Alt键左,右实例。
Windows NT/2000/XP的:应用程序可以获取相应的扫描码向左或向右这些关键之一,例如通过调用的UCODE设置为以下虚拟键码常数之一MapVirtualKey。
VK_LSHIFT
VK_RSHIFT
VK_LCONTROL
VK_RCONTROL
VK_LMENU
VK_RMENU
这些左,右区分常量可用于应用程序只能通过GetKeyboardState,SetKeyboardState,GetAsyncKeyState,GetKeyState和MapVirtualKey功能。
在Windows 95/98/Me:MapVirtualKeyW是支持的Unicode(MSLU)微软层。要使用此,您必须将某些文件到您的应用,概述了对Unicode的Microsoft层在Windows 95/98/Me系统。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为ANSI和Unicode版本。
参见
键盘输入,GetAsyncKeyState,GetKeyboardState,GetKeyState,扫描码,SetKeyboardState
==英文原文==MapVirtualKey Function
The MapVirtualKey function translates (maps) a virtual-key code into a scan code or character value, or translates a scan code into a virtual-key code.
To specify a handle to the keyboard layout to use for translating the specified code, use the MapVirtualKeyEx function.
Syntax
UINT MapVirtualKey( UINT uCode,
UINT uMapType
);
Parameters
uCode
[in] Specifies the virtual-key code or scan code for a key. How this value is interpreted depends on the value of the uMapType parameter.
uMapType
[in] Specifies the translation to perform. The value of this parameter depends on the value of the uCode parameter.
MAPVK_VK_TO_VSC
uCode is a virtual-key code and is translated into a scan code. If it is a virtual-key code that does not distinguish between left- and right-hand keys, the left-hand scan code is returned. If there is no translation, the function returns 0.
MAPVK_VSC_TO_VK
uCode is a scan code and is translated into a virtual-key code that does not distinguish between left- and right-hand keys. If there is no translation, the function returns 0.
MAPVK_VK_TO_CHAR
uCode is a virtual-key code and is translated into an unshifted character value in the low-order word of the return value. Dead keys (diacritics) are indicated by setting the top bit of the return value. If there is no translation, the function returns 0.
MAPVK_VSC_TO_VK_EX
Windows NT/2000/XP: uCode is a scan code and is translated into a virtual-key code that distinguishes between left- and right-hand keys. If there is no translation, the function returns 0.
MAPVK_VK_TO_VSC_EX
Return Value
The return value is either a scan code, a virtual-key code, or a character value, depending on the value of uCode and uMapType. If there is no translation, the return value is zero.
Remarks
An application can use MapVirtualKey to translate scan codes to the virtual-key code constants VK_SHIFT, VK_CONTROL, and VK_MENU, and vice versa. These translations do not distinguish between the left and right instances of the SHIFT, CTRL, or ALT keys.
Windows NT/2000/XP: An application can get the scan code corresponding to the left or right instance of one of these keys by calling MapVirtualKey with uCode set to one of the following virtual-key code constants.
VK_LSHIFT
VK_RSHIFT
VK_LCONTROL
VK_RCONTROL
VK_LMENU
VK_RMENU
These left- and right-distinguishing constants are available to an application only through the GetKeyboardState , SetKeyboardState , GetAsyncKeyState , GetKeyState , and MapVirtualKey functions.
Windows 95/98/Me: MapVirtualKeyW is supported by the Microsoft Layer for Unicode (MSLU). To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems .
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as ANSI and Unicode versions.
See Also
Keyboard Input , GetAsyncKeyState , GetKeyboardState , GetKeyState , MapVirtualKeyEx , SetKeyboardState
==原始网址==http://msdn.microsoft.com/en-us/library/ms646306(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 9:23:00