src/events/scancodes_windows.h
author Ryan C. Gordon <icculus@icculus.org>
Fri, 12 Aug 2016 19:59:00 -0400
changeset 10266 c09f06c4e8c8
parent 9998 f67cf37e9cd4
permissions -rw-r--r--
emscripten: send fake mouse events for touches, like other targets do. (This really should be handled at the higher level and not in the individual targets, but this fixes the immediate bug.)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2308
514f7c1651fc Untested Win32 keyboard scancode code.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     1
/*
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     2
  Simple DirectMedia Layer
9998
f67cf37e9cd4 Updated copyright to 2016
Sam Lantinga <slouken@libsdl.org>
parents: 9644
diff changeset
     3
  Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
2308
514f7c1651fc Untested Win32 keyboard scancode code.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     4
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     5
  This software is provided 'as-is', without any express or implied
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     7
  arising from the use of this software.
2308
514f7c1651fc Untested Win32 keyboard scancode code.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     8
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    11
  freely, subject to the following restrictions:
2308
514f7c1651fc Untested Win32 keyboard scancode code.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    12
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    14
     claim that you wrote the original software. If you use this software
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    16
     appreciated but is not required.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    18
     misrepresented as being the original software.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
2308
514f7c1651fc Untested Win32 keyboard scancode code.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    20
*/
514f7c1651fc Untested Win32 keyboard scancode code.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    21
#include "../../include/SDL_scancode.h"
514f7c1651fc Untested Win32 keyboard scancode code.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    22
6939
06a72f2f8b16 The table is now a scancode mapping table, not a virtual key mapping table
Sam Lantinga <slouken@libsdl.org>
parents: 6925
diff changeset
    23
/* Windows scancode to SDL scancode mapping table */
7327
c250b07cee2c sdl - added comment with URL to windows scancode definition document
Jørgen P. Tjernø <jorgen@valvesoftware.com>
parents: 6939
diff changeset
    24
/* derived from Microsoft scan code document, http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc */
c250b07cee2c sdl - added comment with URL to windows scancode definition document
Jørgen P. Tjernø <jorgen@valvesoftware.com>
parents: 6939
diff changeset
    25
2308
514f7c1651fc Untested Win32 keyboard scancode code.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    26
/* *INDENT-OFF* */
6922
Jørgen P. Tjernø <jorgen@valvesoftware.com>
parents: 6885
diff changeset
    27
static const SDL_Scancode windows_scancode_table[] = 
Jørgen P. Tjernø <jorgen@valvesoftware.com>
parents: 6885
diff changeset
    28
{ 
7663
53fe1b64eb2d More non C89 compliant comments
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7576
diff changeset
    29
	/*	0						1							2							3							4						5							6							7 */
53fe1b64eb2d More non C89 compliant comments
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7576
diff changeset
    30
	/*	8						9							A							B							C						D							E							F */
53fe1b64eb2d More non C89 compliant comments
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7576
diff changeset
    31
	SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_ESCAPE,		SDL_SCANCODE_1,				SDL_SCANCODE_2,				SDL_SCANCODE_3,			SDL_SCANCODE_4,				SDL_SCANCODE_5,				SDL_SCANCODE_6,			/* 0 */
53fe1b64eb2d More non C89 compliant comments
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7576
diff changeset
    32
	SDL_SCANCODE_7,				SDL_SCANCODE_8,				SDL_SCANCODE_9,				SDL_SCANCODE_0,				SDL_SCANCODE_MINUS,		SDL_SCANCODE_EQUALS,		SDL_SCANCODE_BACKSPACE,		SDL_SCANCODE_TAB,		/* 0 */
6922
Jørgen P. Tjernø <jorgen@valvesoftware.com>
parents: 6885
diff changeset
    33
7663
53fe1b64eb2d More non C89 compliant comments
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7576
diff changeset
    34
	SDL_SCANCODE_Q,				SDL_SCANCODE_W,				SDL_SCANCODE_E,				SDL_SCANCODE_R,				SDL_SCANCODE_T,			SDL_SCANCODE_Y,				SDL_SCANCODE_U,				SDL_SCANCODE_I,			/* 1 */
53fe1b64eb2d More non C89 compliant comments
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7576
diff changeset
    35
	SDL_SCANCODE_O,				SDL_SCANCODE_P,				SDL_SCANCODE_LEFTBRACKET,	SDL_SCANCODE_RIGHTBRACKET,	SDL_SCANCODE_RETURN,	SDL_SCANCODE_LCTRL,			SDL_SCANCODE_A,				SDL_SCANCODE_S,			/* 1 */
6922
Jørgen P. Tjernø <jorgen@valvesoftware.com>
parents: 6885
diff changeset
    36
7663
53fe1b64eb2d More non C89 compliant comments
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7576
diff changeset
    37
	SDL_SCANCODE_D,				SDL_SCANCODE_F,				SDL_SCANCODE_G,				SDL_SCANCODE_H,				SDL_SCANCODE_J,			SDL_SCANCODE_K,				SDL_SCANCODE_L,				SDL_SCANCODE_SEMICOLON,	/* 2 */
53fe1b64eb2d More non C89 compliant comments
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7576
diff changeset
    38
	SDL_SCANCODE_APOSTROPHE,	SDL_SCANCODE_GRAVE,			SDL_SCANCODE_LSHIFT,		SDL_SCANCODE_BACKSLASH,		SDL_SCANCODE_Z,			SDL_SCANCODE_X,				SDL_SCANCODE_C,				SDL_SCANCODE_V,			/* 2 */
6922
Jørgen P. Tjernø <jorgen@valvesoftware.com>
parents: 6885
diff changeset
    39
7663
53fe1b64eb2d More non C89 compliant comments
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7576
diff changeset
    40
	SDL_SCANCODE_B,				SDL_SCANCODE_N,				SDL_SCANCODE_M,				SDL_SCANCODE_COMMA,			SDL_SCANCODE_PERIOD,	SDL_SCANCODE_SLASH,			SDL_SCANCODE_RSHIFT,		SDL_SCANCODE_PRINTSCREEN,/* 3 */
53fe1b64eb2d More non C89 compliant comments
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7576
diff changeset
    41
	SDL_SCANCODE_LALT,			SDL_SCANCODE_SPACE,			SDL_SCANCODE_CAPSLOCK,		SDL_SCANCODE_F1,			SDL_SCANCODE_F2,		SDL_SCANCODE_F3,			SDL_SCANCODE_F4,			SDL_SCANCODE_F5,		/* 3 */
6922
Jørgen P. Tjernø <jorgen@valvesoftware.com>
parents: 6885
diff changeset
    42
7663
53fe1b64eb2d More non C89 compliant comments
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7576
diff changeset
    43
	SDL_SCANCODE_F6,			SDL_SCANCODE_F7,			SDL_SCANCODE_F8,			SDL_SCANCODE_F9,			SDL_SCANCODE_F10,		SDL_SCANCODE_NUMLOCKCLEAR,	SDL_SCANCODE_SCROLLLOCK,	SDL_SCANCODE_HOME,		/* 4 */
53fe1b64eb2d More non C89 compliant comments
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7576
diff changeset
    44
	SDL_SCANCODE_UP,			SDL_SCANCODE_PAGEUP,		SDL_SCANCODE_KP_MINUS,		SDL_SCANCODE_LEFT,			SDL_SCANCODE_KP_5,		SDL_SCANCODE_RIGHT,			SDL_SCANCODE_KP_PLUS,		SDL_SCANCODE_END,		/* 4 */
6922
Jørgen P. Tjernø <jorgen@valvesoftware.com>
parents: 6885
diff changeset
    45
7663
53fe1b64eb2d More non C89 compliant comments
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7576
diff changeset
    46
	SDL_SCANCODE_DOWN,			SDL_SCANCODE_PAGEDOWN,		SDL_SCANCODE_INSERT,		SDL_SCANCODE_DELETE,		SDL_SCANCODE_UNKNOWN,	SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_NONUSBACKSLASH,SDL_SCANCODE_F11,		/* 5 */
53fe1b64eb2d More non C89 compliant comments
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7576
diff changeset
    47
	SDL_SCANCODE_F12,			SDL_SCANCODE_PAUSE,			SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_LGUI,			SDL_SCANCODE_RGUI,		SDL_SCANCODE_APPLICATION,	SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,	/* 5 */
6922
Jørgen P. Tjernø <jorgen@valvesoftware.com>
parents: 6885
diff changeset
    48
7663
53fe1b64eb2d More non C89 compliant comments
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7576
diff changeset
    49
	SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_F13,		SDL_SCANCODE_F14,			SDL_SCANCODE_F15,			SDL_SCANCODE_F16,		/* 6 */
53fe1b64eb2d More non C89 compliant comments
Gabriel Jacobo <gabomdq@gmail.com>
parents: 7576
diff changeset
    50
	SDL_SCANCODE_F17,			SDL_SCANCODE_F18,			SDL_SCANCODE_F19,			SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,	SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,	/* 6 */
6922
Jørgen P. Tjernø <jorgen@valvesoftware.com>
parents: 6885
diff changeset
    51
	
9644
2bd2c601df72 Added some unknown keys from Japanese 106/109 keyboards (thanks, "ver0hiro"!).
Ryan C. Gordon <icculus@icculus.org>
parents: 9619
diff changeset
    52
	SDL_SCANCODE_INTERNATIONAL2,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_INTERNATIONAL1,		SDL_SCANCODE_UNKNOWN,	SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN,	/* 7 */
2bd2c601df72 Added some unknown keys from Japanese 106/109 keyboards (thanks, "ver0hiro"!).
Ryan C. Gordon <icculus@icculus.org>
parents: 9619
diff changeset
    53
	SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_INTERNATIONAL4,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_INTERNATIONAL5,		SDL_SCANCODE_UNKNOWN,	SDL_SCANCODE_INTERNATIONAL3,		SDL_SCANCODE_UNKNOWN,		SDL_SCANCODE_UNKNOWN	/* 7 */
2308
514f7c1651fc Untested Win32 keyboard scancode code.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    54
};
514f7c1651fc Untested Win32 keyboard scancode code.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    55
/* *INDENT-ON* */