ReactOS 0.4.16-dev-401-g45b008d
VirtualKey.c File Reference
#include "precomp.h"
Include dependency graph for VirtualKey.c:

Go to the source code of this file.

Functions

static void testMapVirtualKey ()
 
 START_TEST (VirtualKey)
 

Variables

UINT MapTypes []
 
struct {
   UINT   VirtKey
 
   UINT   ScanToVirt
 
   UINT   ScanCode
 
TestCodes []
 

Function Documentation

◆ START_TEST()

START_TEST ( VirtualKey  )

Definition at line 60 of file VirtualKey.c.

61{
63}
static void testMapVirtualKey()
Definition: VirtualKey.c:35

◆ testMapVirtualKey()

static void testMapVirtualKey ( )
static

Definition at line 35 of file VirtualKey.c.

36{
37 INT i;
38 UINT vCode, vExpect = 0;
39
40 /* Make sure MapVirtualKeyW returns 0 in all cases when uCode == 0 */
41 for (i = 0; i < _countof(MapTypes); i++)
42 {
43 vCode = MapVirtualKeyW(0, MapTypes[i]);
44 ok(vCode == vExpect, "[%d] Returned %u, expected %u\n", i, vCode, vExpect);
45 }
46
47 /* Test matching between virtual keys and scan codes */
48 for (i = 0; i < _countof(TestCodes); i++)
49 {
51 vExpect = TestCodes[i].ScanCode;
52 ok(vCode == vExpect, "[%d] ScanCode = %u, expected %u\n", i, vCode, vExpect);
53
55 vExpect = (TestCodes[i].ScanToVirt == 0 ? TestCodes[i].VirtKey : TestCodes[i].ScanToVirt);
56 ok(vCode == vExpect, "[%d] VirtKey = %u, expected %u\n", i, vCode, vExpect);
57 }
58}
struct @1615 TestCodes[]
UINT ScanCode
Definition: VirtualKey.c:24
UINT MapTypes[]
Definition: VirtualKey.c:10
UINT VirtKey
Definition: VirtualKey.c:22
#define ok(value,...)
Definition: atltest.h:57
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
#define _countof(array)
Definition: sndvol32.h:70
int32_t INT
Definition: typedefs.h:58
#define MAPVK_VSC_TO_VK
Definition: winuser.h:2359
UINT WINAPI MapVirtualKeyW(_In_ UINT, _In_ UINT)
#define MAPVK_VK_TO_VSC
Definition: winuser.h:2358

Referenced by START_TEST().

Variable Documentation

◆ MapTypes

UINT MapTypes[]
Initial value:
= {
}
#define MAPVK_VSC_TO_VK_EX
Definition: winuser.h:2361
#define MAPVK_VK_TO_CHAR
Definition: winuser.h:2360
#define MAPVK_VK_TO_VSC_EX
Definition: winuser.h:2362

Definition at line 10 of file VirtualKey.c.

Referenced by testMapVirtualKey().

◆ ScanCode

◆ ScanToVirt

UINT ScanToVirt

Definition at line 23 of file VirtualKey.c.

◆ 

struct { ... } TestCodes[]
Initial value:
= {
{VK_TAB, 0, 15},
{VK_RETURN, 0, 28},
{VK_CONTROL, 0, 29},
{VK_MENU, 0, 56},
{VK_SPACE, 0, 57},
}
#define VK_TAB
Definition: winuser.h:2202
#define VK_SPACE
Definition: winuser.h:2222
#define VK_CONTROL
Definition: winuser.h:2206
#define VK_LCONTROL
Definition: winuser.h:2287
#define VK_RCONTROL
Definition: winuser.h:2288
#define VK_RETURN
Definition: winuser.h:2204
#define VK_MENU
Definition: winuser.h:2207

Referenced by testMapVirtualKey().

◆ VirtKey

UINT VirtKey

Definition at line 22 of file VirtualKey.c.

Referenced by testMapVirtualKey().