User32MapVirtualKeyEx Method
Translates (maps) a virtual-key code into a scan code or character value, or translates a scan code into a virtual-key code.
The function translates the codes using the input language and an input locale identifier.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", CallingConvention = CallingConvention.StdCall,
CharSet = CharSet.Unicode, SetLastError = true)]
public static uint MapVirtualKeyEx(
uint code,
VirtualKeyMappingTypes mapType,
IntPtr hkl
)
<DllImportAttribute("User32.dll", CallingConvention := CallingConvention.StdCall,
CharSet := CharSet.Unicode, SetLastError := true>]
Public Shared Function MapVirtualKeyEx (
code As UInteger,
mapType As VirtualKeyMappingTypes,
hkl As IntPtr
) As UInteger
Dim code As UInteger
Dim mapType As VirtualKeyMappingTypes
Dim hkl As IntPtr
Dim returnValue As UInteger
returnValue = User32.MapVirtualKeyEx(code,
mapType, hkl)
public:
[DllImportAttribute(L"User32.dll", CallingConvention = CallingConvention::StdCall,
CharSet = CharSet::Unicode, SetLastError = true)]
static unsigned int MapVirtualKeyEx(
unsigned int code,
VirtualKeyMappingTypes mapType,
IntPtr hkl
)
[<DllImportAttribute("User32.dll", CallingConvention = CallingConvention.StdCall,
CharSet = CharSet.Unicode, SetLastError = true)>]
static member MapVirtualKeyEx :
code : uint32 *
mapType : VirtualKeyMappingTypes *
hkl : IntPtr -> uint32
No code example is currently available or this language may not be supported.
- code UInt32
-
The virtual-key code or scan code for a key.
How this value is interpreted depends on the value of the mapType parameter.
The high byte of the code value can contain either 0xe0 or 0xe1 to specify the extended scan code.
- mapType VirtualKeyMappingTypes
-
The translation to be performed.
The value of this parameter depends on the value of the code parameter.
- hkl IntPtr
-
Input locale identifier to use for translating the specified code.
This parameter can be any input locale identifier returned by the GetKeyboardLayout(UInt32)
or LoadKeyboardLayout functions.
UInt32
The return value is either a scan code, a virtual-key code, or a character value,
depending on the value of
code and
mapType parameters.
If there is no translation, the return value is
0.
To get extended error information, call
GetLastWin32Error.