DIK KeyCodes: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Add French Keyboard Key)
m (Some wiki formatting)
 
(22 intermediate revisions by 4 users not shown)
Line 1: Line 1:
=Introduction=
{{TOC|side}}
Each key on any keyboard has a unique Direct Input Keyboard (DIK) code. They are '''not''' character symbols.
They refer to the '''position of the key''' on the keyboard. In other words, depending on the keyboard layout, the actual key can change, but its position is always identical.
This is useful to '''fulfill ergonomic needs'''.
 
 
'''In addition to that, using DIK codes has more advantages:'''
* Recognize keys that can not be represented in character equivalents. Function keys for example have no character set code.
* Using the defines below, makes using key codes easier in configs, since the actual code is replaced by a memorable string, e.g {{hl|DIK_K}} instead of {{hl|0x25}}.
* Unique DIK codes exist for numeric pad '9' versus standard key '9'. They are key codes, not character codes.
 
{{Feature|informative|Specific keys cannot be detected with DIK codes, since the position of the keys changes with the Keyboard layout ({{Link|https://en.wikipedia.org/wiki/QWERTY|QWERTY}}, {{Link|https://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard|Dvorak}}).}}
 
 
== Script Usage ==
 
DIK codes are '''always''' accompanied by the state of the {{Controls|Shift}}, {{Controls|Alt}}, and {{Controls|Ctrl}} keys. Any script can differentiate between e.g {{Controls|Q}} and {{Controls|Alt|Q}}.
 
{{Feature|informative|For parameters passed to key event handlers, see [[User Interface Event Handlers#onKeyDown|onKeyDown]] event handler.}}
 
=== Example Script ===


Each key on any keyboard has a unique Direct Input Keyboard (DIK) code. They are '''not''' character symbols.
<sqf>
#include "\a3\ui_f\hpp\definedikcodes.inc"


The '''prime''' purpose of DIK is to recognise key strokes that cannot be represented in character equivalents. Function Keys eg. There is no character set code for F12.
findDisplay 46 displayAddEventHandler ["KeyDown", {
params ["_displayOrControl", "_key", "_shift", "_ctrl", "_alt"];


*Any other purpose is unreliable.
private _override = false;
*Function Key positions aren't necessarily accross the top. Their DIK Codes however, remain the same,
*Unique DIK codes exist for numeric pad '9' versus standard key '9'. These are key-codes, not, characters.


Using DIK to detect the 'S' key depends on keyboard layout. Qwerty versus [http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard Dvorak] eg. Or French versus Arabic.
if (_key isEqualTo DIK_W) then // DIK_W = 17 = 0x11
{
systemChat "You pressed W.";


if (_shift) then
{
systemChat "You are not allowed to use Shift + W!";
_override = true;
};
};


As defined below, the assumption is a US QWERTY Layout.
_override;
}];
</sqf>


Game designers operate within the constraints of
*ergonomic needs: navigation buttons need garanteed finger positions (W,A,S,D eg)
*controls: (Alt Ctl, Shift, Fx) which can be anywhere.


To guarantee ergonomic needs, a QWERTY keyboard is assumed with Western European key variances avoided / not used.
== Defines ==


Dik codes are '''always''' accompanied by the state of the shift, alt, and ctrl keys. Any script can differentiate between 'Q' and Alt-Q (should it wish to).
'''{{arma3}}'''
<syntaxhighlight lang="cpp">#include "\a3\ui_f\hpp\definedikcodes.inc"</syntaxhighlight>


OnkeyDown passes _this array as:
=== DIK Codes for QWERTY ===


_DisplayOrDialogOrControl = _this select 0; // [[Display]], [[Dialog Control|Dialog]] , or [[Control]]
{| class="wikitable sortable"
_DikCode=                  _this select 1; // integer
! Key
_shiftState =                _this select 2; // boolean
! Type
_ctrlState =                  _this select 3; // boolean
! DIK ID
_altState =                    _this select 4; // boolean
! Hexadecimal
! Integer
! Note


=Codes=
|- <!-- F1..F15 -->
! colspan="6" | Function Keys
|-
| F1 || F1..F15 || DIK_F1 || 0x3B || 59 || {{n/a}}
|-
| F2 || F1..F15 || DIK_F2 || 0x3C || 60 || {{n/a}}
|-
| F3 || F1..F15 || DIK_F3 || 0x3D || 61 || {{n/a}}
|-
| F4 || F1..F15 || DIK_F4 || 0x3E || 62 || {{n/a}}
|-
| F5 || F1..F15 || DIK_F5 || 0x3F || 63 || {{n/a}}
|-
| F6 || F1..F15 || DIK_F6 || 0x40 || 64 || {{n/a}}
|-
| F7 || F1..F15 || DIK_F7 || 0x41 || 65 || {{n/a}}
|-
| F8 || F1..F15 || DIK_F8 || 0x42 || 66 || {{n/a}}
|-
| F9 || F1..F15 || DIK_F9 || 0x43 || 67 || {{n/a}}
|-
| F10 || F1..F15 || DIK_F10 || 0x44 || 68 || {{n/a}}
|-
| F11 || F1..F15 || DIK_F11 || 0x57 || 87 || {{n/a}}
|-
| F12 || F1..F15 || DIK_F12 || 0x58 || 88 || {{n/a}}
|-
| F13 || F1..F15 || DIK_F13 || 0x64 || 100 || NEC PC98
|-
| F14 || F1..F15 || DIK_F14 || 0x65 || 101 || NEC PC98
|-
| F15 || F1..F15 || DIK_F15 || 0x66 || 102 || NEC PC98
 
|- <!-- NUMERICAL -->
! colspan="6" | Numeric Keys
|-
| 0 || 0..9 || DIK_0 || 0x0B || 11 || {{n/a}}
|-
| 1 || 0..9 || DIK_1 || 0x02 || 2 || {{n/a}}
|-
| 2 || 0..9 || DIK_2 || 0x03 || 3 || {{n/a}}
|-
| 3 || 0..9 || DIK_3 || 0x04 || 4 || {{n/a}}
|-
| 4 || 0..9 || DIK_4 || 0x05 || 5 || {{n/a}}
|-
| 5 || 0..9 || DIK_5 || 0x06 || 6 || {{n/a}}
|-
| 6 || 0..9 || DIK_6 || 0x07 || 7 || {{n/a}}
|-
| 7 || 0..9 || DIK_7 || 0x08 || 8 || {{n/a}}
|-
| 8 || 0..9 || DIK_8 || 0x09 || 9 || {{n/a}}
|-
| 9 || 0..9 || DIK_9 || 0x0A || 10 || {{n/a}}
 
|- <!-- NUMPAD -->
! colspan="6" | Numpad Keys
|-
| 0 || Numpad || DIK_NUMPAD0 || 0x52 || 82 || {{n/a}}
|-
| 1 || Numpad || DIK_NUMPAD1 || 0x4F || 79 || {{n/a}}
|-
| 2 || Numpad || DIK_NUMPAD2 || 0x50 || 80 || {{n/a}}
|-
| 3 || Numpad || DIK_NUMPAD3 || 0x51 || 81 || {{n/a}}
|-
| 4 || Numpad || DIK_NUMPAD4 || 0x4B || 75 || {{n/a}}
|-
| 5 || Numpad || DIK_NUMPAD5 || 0x4C || 76 || {{n/a}}
|-
| 6 || Numpad || DIK_NUMPAD6 || 0x4D || 77 || {{n/a}}
|-
| 7 || Numpad || DIK_NUMPAD7 || 0x47 || 71 || {{n/a}}
|-
| 8 || Numpad || DIK_NUMPAD8 || 0x48 || 72 || {{n/a}}
|-
| 9 || Numpad || DIK_NUMPAD9 || 0x49 || 73 || {{n/a}}
 
|- <!-- Alphabet -->
! colspan="6" | Alphabet Keys
|-
| A || A..Z || DIK_A || 0x1E || 30 || {{n/a}}
|-
| B || A..Z || DIK_B || 0x30 || 48 || {{n/a}}
|-
| C || A..Z || DIK_C || 0x2E || 46 || {{n/a}}
|-
| D || A..Z || DIK_D || 0x20 || 32 || {{n/a}}
|-
| E || A..Z || DIK_E || 0x12 || 18 || {{n/a}}
|-
| F || A..Z || DIK_F || 0x21 || 33 || {{n/a}}
|-
| G || A..Z || DIK_G || 0x22 || 34 || {{n/a}}
|-
| H || A..Z || DIK_H || 0x23 || 35 || {{n/a}}
|-
| I || A..Z || DIK_I || 0x17 || 23 || {{n/a}}
|-
| J || A..Z || DIK_J || 0x24 || 36 || {{n/a}}
|-
| K || A..Z || DIK_K || 0x25 || 37 || {{n/a}}
|-
| L || A..Z || DIK_L || 0x26 || 38 || {{n/a}}
|-
| M || A..Z || DIK_M || 0x32 || 50 || {{n/a}}
|-
| N || A..Z || DIK_N || 0x31 || 49 || {{n/a}}
|-
| O || A..Z || DIK_O || 0x18 || 24 || {{n/a}}
|-
| P || A..Z || DIK_P || 0x19 || 25 || {{n/a}}
|-
| Q || A..Z || DIK_Q || 0x10 || 16 || {{n/a}}
|-
| R || A..Z || DIK_R || 0x13 || 19 || {{n/a}}
|-
| S || A..Z || DIK_S || 0x1F || 31 || {{n/a}}
|-
| T || A..Z || DIK_T || 0x14 || 20 || {{n/a}}
|-
| U || A..Z || DIK_U || 0x16 || 22 || {{n/a}}
|-
| V || A..Z || DIK_V || 0x2F || 47 || {{n/a}}
|-
| W || A..Z || DIK_W || 0x11 || 17 || {{n/a}}
|-
| X || A..Z || DIK_X || 0x2D || 45 || {{n/a}}
|-
| Y || A..Z || DIK_Y || 0x15 || 21 || {{n/a}}
|-
| Z || A..Z || DIK_Z || 0x2C || 44 || {{n/a}}
 
|- <!-- Control keys -->
! colspan="6" | Control Keys
|-
| Escape || Control key || DIK_ESCAPE || 0x01 || 1 || {{n/a}}
|-
| Tab || Control key || DIK_TAB || 0x0F || 15 || {{n/a}}
|-
| Shift (left) || Control key || DIK_LSHIFT || 0x2A || 42 || {{n/a}}
|-
| Shift (right) || Control key || DIK_RSHIFT || 0x36 || 54 || {{n/a}}
|-
| Control (left) || Control key || DIK_LCONTROL || 0x1D || 29 || {{n/a}}
|-
| Control (right) || Control key || DIK_RCONTROL || 0x9D || 157 || {{n/a}}
|-
| Backspace || Control key || DIK_BACK || 0x0E || 14 || {{n/a}}
|-
| || Control key || DIK_BACKSPACE || colspan="2" | DIK_BACK || {{n/a}}
|-
| Enter (main) || Control key || DIK_RETURN || 0x1C || 28 || {{n/a}}
|-
| Enter (numpad) || Control key || DIK_NUMPADENTER || 0x9C || 156 || {{n/a}}
|-
| Alt (left) || Control key || DIK_LMENU || 0x38 || 56 || {{n/a}}
|-
| || Control key || DIK_LALT || colspan="2" | DIK_LMENU || {{n/a}}
|-
| || Control key || DIK_SPACE || 0x39 || 57 || {{n/a}}
|-
| Caps lock || Control key || DIK_CAPITAL || 0x3A || 58 || {{n/a}}
|-
| Caps lock || Control key || DIK_CAPSLOCK || colspan="2" | DIK_CAPITAL || {{n/a}}
|-
| Num lock (numpad) || Control key || DIK_NUMLOCK || 0x45 || 69 || {{n/a}}
|-
| Scroll lock || Control key || DIK_SCROLL || 0x46 || 70 || {{n/a}}
|-
| Menu button || Control key || DIK_RMENU || 0xB8 || 184 || {{n/a}}
|-
| Alt (right) || Control key || DIK_RALT || colspan="2" | DIK_RMENU || {{n/a}}
|-
| CTRL (left, right) || Control key || INPUT_CTRL_OFFSET || {{n/a}} || 512 || {{n/a}}
|-
| SHIFT (left, right) || Control key || INPUT_SHIFT_OFFSET || {{n/a}} || 1024 || {{n/a}}
|-
| ALT (left, right) || Control key || INPUT_ALT_OFFSET || {{n/a}} || 2048 || {{n/a}}


These DIK code #defines, refer to a US QWERTY layout.
|- <!-- Symbol keys -->
! colspan="6" | Symbol Keys
|-
| || Graphics || DIK_AT || 0x91 || 145 || NEC PC98
|-
| || Graphics || DIK_COLON || 0x92 || 146 || NEC PC98
|-
| || Graphics || DIK_UNDERLINE || 0x93 || 147 || NEC PC98
|-
| Minus (on main keyboard) || Graphics || DIK_MINUS || 0x0C || 12 || {{n/a}}
|-
| || Graphics || DIK_EQUALS || 0x0D || 13 || {{n/a}}
|-
| || Graphics || DIK_LBRACKET || 0x1A || 26 || {{n/a}}
|-
| || Graphics || DIK_RBRACKET || 0x1B || 27 || {{n/a}}
|-
| Semicolon || Graphics || DIK_SEMICOLON || 0x27 || 39 || {{n/a}}
|-
| Apostrophe || Graphics || DIK_APOSTROPHE || 0x28 || 40 || {{n/a}}
|-
| Accent grave || Graphics || DIK_GRAVE || 0x29 || 41 || {{n/a}}
|-
| Backslash || Graphics || DIK_BACKSLASH || 0x2B || 43 || {{n/a}}
|-
| Comma || Graphics || DIK_COMMA || 0x33 || 51 || {{n/a}}
|-
| Period (main) || Graphics || DIK_PERIOD || 0x34 || 52 || {{n/a}}
|-
| Slash (main) || Graphics || DIK_SLASH || 0x35 || 53 || {{n/a}}
|-
| * (numpad) || Graphics || DIK_MULTIPLY || 0x37 || 55 || {{n/a}}
|-
| * (numpad) || Graphics || DIK_NUMPADSTAR || colspan="2" | DIK_MULTIPLY || {{n/a}}
|-
| - (numpad) || Graphics || DIK_SUBTRACT || 0x4A || 74 || {{n/a}}
|-
| + (numpad) || Graphics || DIK_ADD || 0x4E || 78 || {{n/a}}
|-
| . (numpad) || Graphics || DIK_DECIMAL || 0x53 || 83 || {{n/a}}
|-
| {{=}} (numpad) || Graphics || DIK_NUMPADEQUALS || 0x8D || 141 || NEC PC98
|-
| - (numpad) || Graphics || DIK_NUMPADMINUS || colspan="2" | DIK_SUBTRACT || {{n/a}}
|-
| + (numpad) || Graphics || DIK_NUMPADPLUS || colspan="2" | DIK_ADD || {{n/a}}
|-
| . (numpad) || Graphics || DIK_NUMPADPERIOD || colspan="2" | DIK_DECIMAL || {{n/a}}
|-
| / (numpad) || Graphics || DIK_NUMPADSLASH || colspan="2" | DIK_DIVIDE || {{n/a}}


In otherwords treat any ''character'' label as representative of the fixed in concrete key code, '''not''', the 'character' itself.
|- <!-- KataKana -->
! colspan="6" | KataKana Keys
|-
| || KataKana || DIK_KANA || 0x70 || 112 || Japanese keyboard
|-
| || KataKana || DIK_ABNT_C1 || 0x73 || 115 || / ? on Portugese (Brazilian) keyboards
|-
| || KataKana || DIK_CONVERT || 0x79 || 121 || Japanese keyboard
|-
| || KataKana || DIK_NOCONVERT || 0x7B || 123 || Japanese keyboard
|-
| || KataKana || DIK_YEN || 0x7D || 125 || Japanese keyboard
|-
| || KataKana || DIK_OEM_102 || 0x56 || 86 || < > | on UK/Germany keyboards
|-
| || KataKana || DIK_ABNT_C2 || 0x7E || 126 || Numpad . on Portugese (Brazilian) keyboards
|-
| || KataKana || DIK_PREVTRACK || 0x90 || 144 || Previous Track (DIK_CIRCUMFLEX on Japanese keyboard)
|-
| || KataKana || DIK_KANJI || 0x94 || 148 || Japanese keyboard
|-
| || KataKana || DIK_STOP || 0x95 || 149 || NEC PC98
|-
| || KataKana || DIK_AX || 0x96 || 150 || Japan AX
|-
| || KataKana || DIK_UNLABELED || 0x97 || 151 || J3100
|-
| || KataKana || DIK_NUMPADCOMMA || 0xB3 || 179 || , on numeric keypad - NEC PC98
|-
| || KataKana || DIK_CIRCUMFLEX || colspan="2" | DIK_PREVTRACK || Japanese keyboard


==Headers==
|- <!-- Apps -->
! colspan="6" | App Keys
|-
| || Apps || DIK_NEXTTRACK || 0x99 || 153 || Next Track
|-
| || Apps || DIK_MUTE || 0xA0 || 160 || Mute
|-
| || Apps || DIK_CALCULATOR || 0xA1 || 161 || Calculator
|-
| || Apps || DIK_PLAYPAUSE || 0xA2 || 162 || Play / Pause
|-
| || Apps || DIK_MEDIASTOP || 0xA4 || 164 || Media Stop
|-
| || Apps || DIK_VOLUMEDOWN || 0xAE || 174 || Volume -
|-
| || Apps || DIK_VOLUMEUP || 0xB0 || 176 || Volume +
|-
| || Apps || DIK_WEBHOME || 0xB2 || 178 || Web home
|-
| || Apps || DIK_SYSRQ || 0xB7 || 183 || {{n/a}}
|-
| || Apps || DIK_PAUSE || 0xC5 || 197 || Pause
|-
| || Apps || DIK_APPS || 0xDD || 221 || AppMenu key
|-
| || Apps || DIK_POWER || 0xDE || 222 || System Power
|-
| || Apps || DIK_SLEEP || 0xDF || 223 || System Sleep
|-
| || Apps || DIK_WAKE || 0xE3 || 227 || System Wake
|-
| || Apps || DIK_WEBSEARCH || 0xE5 || 229 || Web Search
|-
| || Apps || DIK_WEBFAVORITES || 0xE6 || 230 || Web Favorites
|-
| || Apps || DIK_WEBREFRESH || 0xE7 || 231 || Web Refresh
|-
| || Apps || DIK_WEBSTOP || 0xE8 || 232 || Web Stop
|-
| || Apps || DIK_WEBFORWARD || 0xE9 || 233 || Web Forward
|-
| || Apps || DIK_WEBBACK || 0xEA || 234 || Web Back
|-
| || Apps || DIK_MYCOMPUTER || 0xEB || 235 || My Computer
|-
| || Apps || DIK_MAIL || 0xEC || 236 || Mail
|-
| || Apps || DIK_MEDIASELECT || 0xED || 237 || Media Select


Regardless of original source, these are bis declarations. They are free to change the rules whenever it suits them. Depending on context: you *might* be better off making copies of these, current, headers so that your scripts and your configs know what you're talking about.
|- <!-- ArrowKeypad -->
! colspan="6" | Arrow Keypad
|-
| || ArrowKeypad || DIK_HOME || 0xC7 || 199 || Home on arrow keypad
|-
| || ArrowKeypad || DIK_UP || 0xC8 || 200 || UpArrow on arrow keypad
|-
| || ArrowKeypad || DIK_PRIOR || 0xC9 || 201 || PgUp on arrow keypad
|-
| || ArrowKeypad || DIK_LEFT || 0xCB || 203 || LeftArrow on arrow keypad
|-
| || ArrowKeypad || DIK_RIGHT || 0xCD || 205 || RightArrow on arrow keypad
|-
| || ArrowKeypad || DIK_END || 0xCF || 207 || End on arrow keypad
|-
| || ArrowKeypad || DIK_DOWN || 0xD0 || 208 || DownArrow on arrow keypad
|-
| || ArrowKeypad || DIK_NEXT || 0xD1 || 209 || PgDn on arrow keypad
|-
| || ArrowKeypad || DIK_INSERT || 0xD2 || 210 || Insert on arrow keypad
|-
| || ArrowKeypad || DIK_DELETE || 0xD3 || 211 || Delete on arrow keypad
|-
| || ArrowKeypad || DIK_UPARROW || colspan="2" | DIK_UP || UpArrow on arrow keypad
|-
| || ArrowKeypad || DIK_PGUP || colspan="2" | DIK_PRIOR || PgUp on arrow keypad
|-
| || ArrowKeypad || DIK_LEFTARROW || colspan="2" | DIK_LEFT || LeftArrow on arrow keypad
|-
| || ArrowKeypad || DIK_RIGHTARROW || colspan="2" | DIK_RIGHT || RightArrow on arrow keypad
|-
| || ArrowKeypad || DIK_DOWNARROW || colspan="2" | DIK_DOWN || DownArrow on arrow keypad
|-
| || ArrowKeypad || DIK_PGDN || colspan="2" | DIK_NEXT || PgDn on arrow keypad


===VBS2===
|- <!-- Others -->
To use these predefined codes, have the following include statement in your script or config:<br>
! colspan="6" | Other Keys
#include "\vbs2\headers\dikCodes.hpp"
|-
===Personal Tools===
| OS key (left) || Other || DIK_LWIN || 0xDB || 219 || Left Windows key
#include "\bin\dikCodes.h"
|-
==Defines==
| OS key (right) || Other || DIK_RWIN || 0xDC || 220 || Right Windows key
===Alphabetic sort===
|}
====F1..15====
<div style="display: flex">
<pre>
<div style="padding-right: 2em">
DIK_F1              0x3B
DIK_F2              0x3C
DIK_F3              0x3D
DIK_F4              0x3E
DIK_F5              0x3F
DIK_F6              0x40
DIK_F7              0x41
DIK_F8              0x42
DIK_F9              0x43
DIK_F10            0x44
DIK_F11            0x57
DIK_F12            0x58
DIK_F13            0x64    /*                    (NEC PC98) */
DIK_F14            0x65    /*                    (NEC PC98) */
DIK_F15            0x66    /*                    (NEC PC98) */
</pre>
====0..9====
<pre>
DIK_0              0x0B
DIK_1              0x02
DIK_2              0x03
DIK_3              0x04
DIK_4              0x05
DIK_5              0x06
DIK_6              0x07
DIK_7              0x08
DIK_8              0x09
DIK_9              0x0A
DIK_NUMPAD0        0x52
DIK_NUMPAD1        0x4F
DIK_NUMPAD2        0x50
DIK_NUMPAD3        0x51
DIK_NUMPAD4        0x4B
DIK_NUMPAD5        0x4C
DIK_NUMPAD6        0x4D
DIK_NUMPAD7        0x47
DIK_NUMPAD8        0x48
DIK_NUMPAD9        0x49
</pre>
====alpha====
<pre>
DIK_A              0x1E
DIK_B              0x30
DIK_C              0x2E
DIK_D              0x20
DIK_E              0x12
DIK_F              0x21
DIK_G              0x22
DIK_H              0x23
DIK_I              0x17
DIK_J              0x24
DIK_K              0x25
DIK_L              0x26
DIK_M              0x32
DIK_N              0x31
DIK_O              0x18
DIK_P              0x19
DIK_Q              0x10
DIK_R              0x13
DIK_S              0x1F
DIK_T              0x14
DIK_U              0x16
DIK_V              0x2F
DIK_W              0x11
DIK_X              0x2D
DIK_Y              0x15
DIK_Z              0x2C
</pre>
====Controls====
<pre>
DIK_ESCAPE          0x01
DIK_TAB            0x0F
DIK_LSHIFT          0x2A
DIK_RSHIFT          0x36
DIK_LCONTROL        0x1D
DIK_RCONTROL        0x9D
DIK_BACK            0x0E    /* backspace */
DIK_BACKSPACE      DIK_BACK
DIK_RETURN          0x1C    /* Enter on main keyboard */
DIK_NUMPADENTER    0x9C    /* Enter on numeric keypad */
DIK_LMENU          0x38    /* left Alt */
DIK_LALT            DIK_LMENU
DIK_SPACE          0x39
DIK_CAPITAL        0x3A    /* capslock */
DIK_CAPSLOCK        DIK_CAPITAL
DIK_NUMLOCK        0x45
DIK_SCROLL          0x46    /* Scroll Lock */
DIK_RMENU          0xB8    /* right Alt */
DIK_RALT            DIK_RMENU          /* right Alt */
</pre>
====Graphics====
<pre>
DIK_AT              0x91    /*                    (NEC PC98) */
DIK_COLON          0x92    /*                    (NEC PC98) */
DIK_UNDERLINE      0x93    /*                    (NEC PC98) */
DIK_MINUS          0x0C    /* - on main keyboard */
DIK_EQUALS          0x0D
DIK_LBRACKET        0x1A
DIK_RBRACKET        0x1B
DIK_SEMICOLON      0x27
DIK_APOSTROPHE      0x28
DIK_GRAVE          0x29    /* accent grave */
DIK_BACKSLASH      0x2B
DIK_COMMA          0x33
DIK_PERIOD          0x34    /* . on main keyboard */
DIK_SLASH          0x35    /* / on main keyboard */
DIK_MULTIPLY        0x37    /* * on numeric keypad */
DIK_NUMPADSTAR      DIK_MULTIPLY
DIK_SUBTRACT        0x4A    /* - on numeric keypad */
DIK_ADD            0x4E    /* + on numeric keypad */
DIK_DECIMAL        0x53    /* . on numeric keypad */
DIK_NUMPADEQUALS    0x8D    /* = on numeric keypad (NEC PC98) */
DIK_NUMPADMINUS    DIK_SUBTRACT        /* - on numeric keypad */
DIK_NUMPADPLUS      DIK_ADD            /* + on numeric keypad */
DIK_NUMPADPERIOD    DIK_DECIMAL        /* . on numeric keypad */
DIK_NUMPADSLASH    DIK_DIVIDE          /* / on numeric keypad */
</pre>
====KataKana====
<pre>
DIK_KANA            0x70    /* (Japanese keyboard)            */
DIK_ABNT_C1        0x73    /* / ? on Portugese (Brazilian) keyboards */
DIK_CONVERT        0x79    /* (Japanese keyboard)            */
DIK_NOCONVERT      0x7B    /* (Japanese keyboard)            */
DIK_YEN            0x7D    /* (Japanese keyboard)            */
DIK_OEM_102        0x56    /* < > | on UK/Germany keyboards */
DIK_ABNT_C2        0x7E    /* Numpad . on Portugese (Brazilian) keyboards */
DIK_PREVTRACK      0x90    /* Previous Track (DIK_CIRCUMFLEX on Japanese keyboard) */
DIK_KANJI          0x94    /* (Japanese keyboard)            */
DIK_STOP            0x95    /*                    (NEC PC98) */
DIK_AX              0x96    /*                    (Japan AX) */
DIK_UNLABELED      0x97    /*                        (J3100) */
DIK_NUMPADCOMMA    0xB3    /* , on numeric keypad (NEC PC98) */
/* Alternate names for keys originally not used on US keyboards. */
DIK_CIRCUMFLEX      DIK_PREVTRACK      /* Japanese keyboard */
</pre>
====Apps====
<pre>
DIK_NEXTTRACK      0x99    /* Next Track */
DIK_MUTE            0xA0    /* Mute */
DIK_CALCULATOR      0xA1    /* Calculator */
DIK_PLAYPAUSE      0xA2    /* Play / Pause */
DIK_MEDIASTOP      0xA4    /* Media Stop */
DIK_VOLUMEDOWN      0xAE    /* Volume - */
DIK_VOLUMEUP        0xB0    /* Volume + */
DIK_WEBHOME        0xB2    /* Web home */
DIK_SYSRQ          0xB7
DIK_PAUSE          0xC5    /* Pause */
DIK_APPS            0xDD    /* AppMenu key */
DIK_POWER          0xDE    /* System Power */
DIK_SLEEP          0xDF    /* System Sleep */
DIK_WAKE            0xE3    /* System Wake */
DIK_WEBSEARCH      0xE5    /* Web Search */
DIK_WEBFAVORITES    0xE6    /* Web Favorites */
DIK_WEBREFRESH      0xE7    /* Web Refresh */
DIK_WEBSTOP        0xE8    /* Web Stop */
DIK_WEBFORWARD      0xE9    /* Web Forward */
DIK_WEBBACK        0xEA    /* Web Back */
DIK_MYCOMPUTER      0xEB    /* My Computer */
DIK_MAIL            0xEC    /* Mail */
DIK_MEDIASELECT    0xED    /* Media Select */
</pre>
====ArrowKeypad====
<pre>
DIK_HOME            0xC7    /* Home on arrow keypad */
DIK_UP              0xC8    /* UpArrow on arrow keypad */
DIK_PRIOR          0xC9    /* PgUp on arrow keypad */
DIK_LEFT            0xCB    /* LeftArrow on arrow keypad */
DIK_RIGHT          0xCD    /* RightArrow on arrow keypad */
DIK_END            0xCF    /* End on arrow keypad */
DIK_DOWN            0xD0    /* DownArrow on arrow keypad */
DIK_NEXT            0xD1    /* PgDn on arrow keypad */
DIK_INSERT          0xD2    /* Insert on arrow keypad */
DIK_DELETE          0xD3    /* Delete on arrow keypad */
DIK_UPARROW        DIK_UP              /* UpArrow on arrow keypad */
DIK_PGUP            DIK_PRIOR          /* PgUp on arrow keypad */
DIK_LEFTARROW      DIK_LEFT            /* LeftArrow on arrow keypad */
DIK_RIGHTARROW      DIK_RIGHT          /* RightArrow on arrow keypad */
DIK_DOWNARROW      DIK_DOWN            /* DownArrow on arrow keypad */
DIK_PGDN            DIK_NEXT            /* PgDn on arrow keypad */
</pre>
====other====
<pre>
DIK_LWIN            0xDB    /* Left Windows key */
DIK_RWIN            0xDC    /* Right Windows key */
</pre>


===Numeric sort===
<pre>
DIK_ESCAPE          0x01
DIK_1              0x02
DIK_2              0x03
DIK_3              0x04
DIK_4              0x05
DIK_5              0x06
DIK_6              0x07
DIK_7              0x08
DIK_8              0x09
DIK_9              0x0A
DIK_0              0x0B
DIK_MINUS          0x0C    /* - on main keyboard */
DIK_EQUALS          0x0D
DIK_BACK            0x0E    /* backspace */
DIK_TAB            0x0F
DIK_Q              0x10
DIK_W              0x11
DIK_E              0x12
DIK_R              0x13
DIK_T              0x14
DIK_Y              0x15
DIK_U              0x16
DIK_I              0x17
DIK_O              0x18
DIK_P              0x19
DIK_LBRACKET        0x1A
DIK_RBRACKET        0x1B
DIK_RETURN          0x1C    /* Enter on main keyboard */
DIK_LCONTROL        0x1D
DIK_A              0x1E
DIK_S              0x1F
DIK_D              0x20
DIK_F              0x21
DIK_G              0x22
DIK_H              0x23
DIK_J              0x24
DIK_K              0x25
DIK_L              0x26
DIK_SEMICOLON      0x27
DIK_APOSTROPHE      0x28
DIK_GRAVE          0x29    /* accent grave */
DIK_LSHIFT          0x2A
DIK_BACKSLASH      0x2B
DIK_Z              0x2C
DIK_X              0x2D
DIK_C              0x2E
DIK_V              0x2F
DIK_B              0x30
DIK_N              0x31
DIK_M              0x32
DIK_COMMA          0x33
DIK_PERIOD          0x34    /* . on main keyboard */
DIK_SLASH          0x35    /* / on main keyboard */
DIK_RSHIFT          0x36
DIK_MULTIPLY        0x37    /* * on numeric keypad */
DIK_LMENU          0x38    /* left Alt */
DIK_SPACE          0x39
DIK_CAPITAL        0x3A
DIK_F1              0x3B
DIK_F2              0x3C
DIK_F3              0x3D
DIK_F4              0x3E
DIK_F5              0x3F
DIK_F6              0x40
DIK_F7              0x41
DIK_F8              0x42
DIK_F9              0x43
DIK_F10            0x44
DIK_NUMLOCK        0x45
DIK_SCROLL          0x46    /* Scroll Lock */
DIK_NUMPAD7        0x47
DIK_NUMPAD8        0x48
DIK_NUMPAD9        0x49
DIK_SUBTRACT        0x4A    /* - on numeric keypad */
DIK_NUMPAD4        0x4B
DIK_NUMPAD5        0x4C
DIK_NUMPAD6        0x4D
DIK_ADD            0x4E    /* + on numeric keypad */
DIK_NUMPAD1        0x4F
DIK_NUMPAD2        0x50
DIK_NUMPAD3        0x51
DIK_NUMPAD0        0x52
DIK_DECIMAL        0x53    /* . on numeric keypad */
DIK_OEM_102        0x56    /* < > | on UK/Germany keyboards */
DIK_F11            0x57
DIK_F12            0x58
DIK_F13            0x64    /*                    (NEC PC98) */
DIK_F14            0x65    /*                    (NEC PC98) */
DIK_F15            0x66    /*                    (NEC PC98) */
DIK_KANA            0x70    /* (Japanese keyboard)            */
DIK_ABNT_C1        0x73    /* / ? on Portugese (Brazilian) keyboards */
DIK_CONVERT        0x79    /* (Japanese keyboard)            */
DIK_NOCONVERT      0x7B    /* (Japanese keyboard)            */
DIK_YEN            0x7D    /* (Japanese keyboard)            */
DIK_ABNT_C2        0x7E    /* Numpad . on Portugese (Brazilian) keyboards */
DIK_NUMPADEQUALS    0x8D    /* = on numeric keypad (NEC PC98) */
DIK_PREVTRACK      0x90    /* Previous Track (DIK_CIRCUMFLEX on Japanese keyboard) */
DIK_AT              0x91    /*                    (NEC PC98) */
DIK_COLON          0x92    /*                    (NEC PC98) */
DIK_UNDERLINE      0x93    /*                    (NEC PC98) */
DIK_KANJI          0x94    /* (Japanese keyboard)            */
DIK_STOP            0x95    /*                    (NEC PC98) */
DIK_AX              0x96    /*                    (Japan AX) */
DIK_UNLABELED      0x97    /*                        (J3100) */
DIK_NEXTTRACK      0x99    /* Next Track */
DIK_NUMPADENTER    0x9C    /* Enter on numeric keypad */
DIK_RCONTROL        0x9D
DIK_MUTE            0xA0    /* Mute */
DIK_CALCULATOR      0xA1    /* Calculator */
DIK_PLAYPAUSE      0xA2    /* Play / Pause */
DIK_MEDIASTOP      0xA4    /* Media Stop */
DIK_VOLUMEDOWN      0xAE    /* Volume - */
DIK_VOLUMEUP        0xB0    /* Volume + */
DIK_WEBHOME        0xB2    /* Web home */
DIK_NUMPADCOMMA    0xB3    /* , on numeric keypad (NEC PC98) */
DIK_DIVIDE          0xB5    /* / on numeric keypad */
DIK_SYSRQ          0xB7
DIK_RMENU          0xB8    /* right Alt */
DIK_PAUSE          0xC5    /* Pause */
DIK_HOME            0xC7    /* Home on arrow keypad */
DIK_UP              0xC8    /* UpArrow on arrow keypad */
DIK_PRIOR          0xC9    /* PgUp on arrow keypad */
DIK_LEFT            0xCB    /* LeftArrow on arrow keypad */
DIK_RIGHT          0xCD    /* RightArrow on arrow keypad */
DIK_END            0xCF    /* End on arrow keypad */
DIK_DOWN            0xD0    /* DownArrow on arrow keypad */
DIK_NEXT            0xD1    /* PgDn on arrow keypad */
DIK_INSERT          0xD2    /* Insert on arrow keypad */
DIK_DELETE          0xD3    /* Delete on arrow keypad */
DIK_LWIN            0xDB    /* Left Windows key */
DIK_RWIN            0xDC    /* Right Windows key */
DIK_APPS            0xDD    /* AppMenu key */
DIK_POWER          0xDE    /* System Power */
DIK_SLEEP          0xDF    /* System Sleep */
DIK_WAKE            0xE3    /* System Wake */
DIK_WEBSEARCH      0xE5    /* Web Search */
DIK_WEBFAVORITES    0xE6    /* Web Favorites */
DIK_WEBREFRESH      0xE7    /* Web Refresh */
DIK_WEBSTOP        0xE8    /* Web Stop */
DIK_WEBFORWARD      0xE9    /* Web Forward */
DIK_WEBBACK        0xEA    /* Web Back */
DIK_MYCOMPUTER      0xEB    /* My Computer */
DIK_MAIL            0xEC    /* Mail */
DIK_MEDIASELECT    0xED    /* Media Select */


/* Alternate names for keys, to facilitate transition from DOS. */
== German Keyboard ==
DIK_BACKSPACE      DIK_BACK            /* backspace */
DIK_NUMPADSTAR      DIK_MULTIPLY        /* * on numeric keypad */
DIK_LALT            DIK_LMENU          /* left Alt */
DIK_CAPSLOCK        DIK_CAPITAL        /* CapsLock */
DIK_NUMPADMINUS    DIK_SUBTRACT        /* - on numeric keypad */
DIK_NUMPADPLUS      DIK_ADD            /* + on numeric keypad */
DIK_NUMPADPERIOD    DIK_DECIMAL        /* . on numeric keypad */
DIK_NUMPADSLASH    DIK_DIVIDE          /* / on numeric keypad */
DIK_RALT            DIK_RMENU          /* right Alt */
DIK_UPARROW        DIK_UP              /* UpArrow on arrow keypad */
DIK_PGUP            DIK_PRIOR          /* PgUp on arrow keypad */
DIK_LEFTARROW      DIK_LEFT            /* LeftArrow on arrow keypad */
DIK_RIGHTARROW      DIK_RIGHT          /* RightArrow on arrow keypad */
DIK_DOWNARROW      DIK_DOWN            /* DownArrow on arrow keypad */
DIK_PGDN            DIK_NEXT            /* PgDn on arrow keypad */


/* Alternate names for keys originally not used on US keyboards. */
{| class="wikitable sortable align-center"
DIK_CIRCUMFLEX      DIK_PREVTRACK      /* Japanese keyboard */
! Number
</pre>
! Key Name
=German keyboard=
! Number
{| class="wikitable" style="text-align:center"
! Key Name
! Number
! Key Name
|-
|-
| 1 || ESC || 11 || 0 || 21 || Z
| 1 || ESC || 11 || 0 || 21 || Z
Line 417: Line 440:
| 6 || 5 || 16 || Q || 26 || Ü
| 6 || 5 || 16 || Q || 26 || Ü
|-
|-
| 7 || 6 || 17 || W ||  
| 7 || 6 || 17 || W || ||
|-
|-
| 8 || 7 || 18 || E || 28 || ENTER
| 8 || 7 || 18 || E || 28 || ENTER
Line 424: Line 447:
|-
|-
| 10 || 9 || 20 || T || 30 || A
| 10 || 9 || 20 || T || 30 || A
|-
|  ||  ||  ||  ||  ||
|-
|-
| 31 || S || 41 || ^ || 51 || ,
| 31 || S || 41 || ^ || 51 || ,
Line 446: Line 467:
|-
|-
| 40 || Ä || 50 || M || 60 || F2
| 40 || Ä || 50 || M || 60 || F2
|-
|  ||  ||  ||  ||  ||
|-
|-
| 61 || F3 || 71 || NUM_7 || 81 || NUM_3
| 61 || F3 || 71 || NUM_7 || 81 || NUM_3
Line 455: Line 474:
| 63 || F5 || 73 || NUM_9 || 83 || NUM_,
| 63 || F5 || 73 || NUM_9 || 83 || NUM_,
|-
|-
| 64 || F6 || 74 || NUM_- || ||
| 64 || F6 || 74 || NUM_- || ||
|-
|-
| 65 || F7 || 75 || NUM_4 || ||
| 65 || F7 || 75 || NUM_4 || ||
|-
|-
| 66 || F8 || 76 || NUM_5 || 86 || <
| 66 || F8 || 76 || NUM_5 || 86 || <
Line 465: Line 484:
| 68 || F10 || 78 || NUM_+ || 88 || F12
| 68 || F10 || 78 || NUM_+ || 88 || F12
|-
|-
| 69 || NUM || 79 || NUM_1 || ||
| 69 || NUM || 79 || NUM_1 || ||
|-
|-
| 70 || SCROLL || 80 || NUM_2 || ||
| 70 || SCROLL || 80 || NUM_2 || ||
|-
|  ||  ||  ||  ||  ||
|-
|-
| 156 || NUM_ENTER || 200 || UP || 211 || DELETE
| 156 || NUM_ENTER || 200 || UP || 211 || DELETE
Line 475: Line 492:
| 157 || STRGR || 201 || PAGEUP || 219 || WINR
| 157 || STRGR || 201 || PAGEUP || 219 || WINR
|-
|-
| || || 220 || WINL || ||
| || || 220 || WINL || ||
|-
|-
| 181 || NUM_/ || 203 || LEFT || 221 || APP
| 181 || NUM_/ || 203 || LEFT || 221 || APP
|-
|-
| 183 || PRINT || || ||
| 183 || PRINT || || || ||
|-
|-
| 184 || ALTGR || 205 || RIGHT || NOT DEFINED || +
| 184 || ALTGR || 205 || RIGHT || NOT DEFINED || +
|-
|-
| || || || || ||
| 197 || PAUSE || 207 || END || ||
|-
|-
| 197 || PAUSE || 207 || END || ||
| 199 || POS1 || 208 || DOWN || ||
|-
|-
| 199 || POS1 || 208 || DOWN || ||
| || || 209 || PAGEDOWN || ||
|-
|-
| || || 209 || PAGEDOWN ||  ||
| || || 210 || INSERT || ||
|-
|  ||  || 210 || INSERT || ||
|}
|}
</div>
<div style="padding-right: 2em">


=French keyboard=
 
{| class="wikitable" style="text-align:center"
== French Keyboard ==
 
{| class="wikitable align-center"
! Number
! Key Name
! Number
! Key Name
! Number
! Key Name
|-
|-
| 1 || ESC || 11 || 0 || 21 || Y
| 1 || ESC || 11 || 0 || 21 || Y
Line 517: Line 542:
| 10 || 9 || 20 || T || 30 || Q
| 10 || 9 || 20 || T || 30 || Q
|-
|-
|  ||  ||  ||  ||  ||
|-
|-
| 31 || S || 41 || ² || 51 || ;
| 31 || S || 41 || ² || 51 || ;
Line 538: Line 562:
|-
|-
| 40 || ù || 50 || , || 60 || F2
| 40 || ù || 50 || , || 60 || F2
|-
|  ||  ||  ||  ||  ||
|-
|-
| 61 || F3 || 71 || NUM_7 || 81 || NUM_3
| 61 || F3 || 71 || NUM_7 || 81 || NUM_3
Line 547: Line 569:
| 63 || F5 || 73 || NUM_9 || 83 || NUM_.
| 63 || F5 || 73 || NUM_9 || 83 || NUM_.
|-
|-
| 64 || F6 || 74 || NUM_- || ||
| 64 || F6 || 74 || NUM_- || ||
|-
|-
| 65 || F7 || 75 || NUM_4 || ||
| 65 || F7 || 75 || NUM_4 || ||
|-
|-
| 66 || F8 || 76 || NUM_5 || 86 || <
| 66 || F8 || 76 || NUM_5 || 86 || <
Line 557: Line 579:
| 68 || F10 || 78 || NUM_+ || 88 || F12
| 68 || F10 || 78 || NUM_+ || 88 || F12
|-
|-
| 69 || NUM || 79 || NUM_1 || ||
| 69 || NUM || 79 || NUM_1 || ||
|-
|-
| 70 || SCROLL || 80 || NUM_2 || ||
| 70 || SCROLL || 80 || NUM_2 || ||
|-
|  ||  ||  ||  ||  ||
|-
|-
| 156 || NUM_ENTER || 200 || UP || 211 || DELETE
| 156 || NUM_ENTER || 200 || UP || 211 || DELETE
Line 567: Line 587:
| 157 || CTRLR || 201 || PAGEUP || 219 || WINR
| 157 || CTRLR || 201 || PAGEUP || 219 || WINR
|-
|-
| || || 220 || WINL || ||
| || || 220 || WINL || ||
|-
|-
| 181 || NUM_/ || 203 || LEFT || 221 || APP
| 181 || NUM_/ || 203 || LEFT || 221 || APP
|-
|-
| 183 || PRINT || || ||
| 183 || PRINT || || || ||
|-
|-
| 184 || ALTGR || 205 || RIGHT || NOT DEFINED || +
| 184 || ALTGR || 205 || RIGHT || NOT DEFINED || +
|-
|-
|  ||  ||  ||  ||  ||
| 197 || PAUSE || 207 || END || ||
|-
| 197 || PAUSE || 207 || END || ||
|-
|-
| 199 || POS1 || 208 || DOWN || ||
| 199 || POS1 || 208 || DOWN || ||
|-
|-
| || || 209 || PAGEDOWN || ||
| || || 209 || PAGEDOWN || ||
|-
|-
| || || 210 || INSERT || ||
| || || 210 || INSERT || ||
|}
|}
</div>
</div>


[[Category:Reference Lists]]
[[Category:Reference Lists]]

Latest revision as of 15:49, 14 September 2023

Each key on any keyboard has a unique Direct Input Keyboard (DIK) code. They are not character symbols. They refer to the position of the key on the keyboard. In other words, depending on the keyboard layout, the actual key can change, but its position is always identical. This is useful to fulfill ergonomic needs.


In addition to that, using DIK codes has more advantages:

  • Recognize keys that can not be represented in character equivalents. Function keys for example have no character set code.
  • Using the defines below, makes using key codes easier in configs, since the actual code is replaced by a memorable string, e.g DIK_K instead of 0x25.
  • Unique DIK codes exist for numeric pad '9' versus standard key '9'. They are key codes, not character codes.
Specific keys cannot be detected with DIK codes, since the position of the keys changes with the Keyboard layout (QWERTY, Dvorak).


Script Usage

DIK codes are always accompanied by the state of the ⇧ Shift, Alt, and Ctrl keys. Any script can differentiate between e.g Q and Alt + Q.

For parameters passed to key event handlers, see onKeyDown event handler.

Example Script

#include "\a3\ui_f\hpp\definedikcodes.inc" findDisplay 46 displayAddEventHandler ["KeyDown", { params ["_displayOrControl", "_key", "_shift", "_ctrl", "_alt"]; private _override = false; if (_key isEqualTo DIK_W) then // DIK_W = 17 = 0x11 { systemChat "You pressed W."; if (_shift) then { systemChat "You are not allowed to use Shift + W!"; _override = true; }; }; _override; }];


Defines

Arma 3

#include "\a3\ui_f\hpp\definedikcodes.inc"

DIK Codes for QWERTY

Key Type DIK ID Hexadecimal Integer Note
Function Keys
F1 F1..F15 DIK_F1 0x3B 59 N/A
F2 F1..F15 DIK_F2 0x3C 60 N/A
F3 F1..F15 DIK_F3 0x3D 61 N/A
F4 F1..F15 DIK_F4 0x3E 62 N/A
F5 F1..F15 DIK_F5 0x3F 63 N/A
F6 F1..F15 DIK_F6 0x40 64 N/A
F7 F1..F15 DIK_F7 0x41 65 N/A
F8 F1..F15 DIK_F8 0x42 66 N/A
F9 F1..F15 DIK_F9 0x43 67 N/A
F10 F1..F15 DIK_F10 0x44 68 N/A
F11 F1..F15 DIK_F11 0x57 87 N/A
F12 F1..F15 DIK_F12 0x58 88 N/A
F13 F1..F15 DIK_F13 0x64 100 NEC PC98
F14 F1..F15 DIK_F14 0x65 101 NEC PC98
F15 F1..F15 DIK_F15 0x66 102 NEC PC98
Numeric Keys
0 0..9 DIK_0 0x0B 11 N/A
1 0..9 DIK_1 0x02 2 N/A
2 0..9 DIK_2 0x03 3 N/A
3 0..9 DIK_3 0x04 4 N/A
4 0..9 DIK_4 0x05 5 N/A
5 0..9 DIK_5 0x06 6 N/A
6 0..9 DIK_6 0x07 7 N/A
7 0..9 DIK_7 0x08 8 N/A
8 0..9 DIK_8 0x09 9 N/A
9 0..9 DIK_9 0x0A 10 N/A
Numpad Keys
0 Numpad DIK_NUMPAD0 0x52 82 N/A
1 Numpad DIK_NUMPAD1 0x4F 79 N/A
2 Numpad DIK_NUMPAD2 0x50 80 N/A
3 Numpad DIK_NUMPAD3 0x51 81 N/A
4 Numpad DIK_NUMPAD4 0x4B 75 N/A
5 Numpad DIK_NUMPAD5 0x4C 76 N/A
6 Numpad DIK_NUMPAD6 0x4D 77 N/A
7 Numpad DIK_NUMPAD7 0x47 71 N/A
8 Numpad DIK_NUMPAD8 0x48 72 N/A
9 Numpad DIK_NUMPAD9 0x49 73 N/A
Alphabet Keys
A A..Z DIK_A 0x1E 30 N/A
B A..Z DIK_B 0x30 48 N/A
C A..Z DIK_C 0x2E 46 N/A
D A..Z DIK_D 0x20 32 N/A
E A..Z DIK_E 0x12 18 N/A
F A..Z DIK_F 0x21 33 N/A
G A..Z DIK_G 0x22 34 N/A
H A..Z DIK_H 0x23 35 N/A
I A..Z DIK_I 0x17 23 N/A
J A..Z DIK_J 0x24 36 N/A
K A..Z DIK_K 0x25 37 N/A
L A..Z DIK_L 0x26 38 N/A
M A..Z DIK_M 0x32 50 N/A
N A..Z DIK_N 0x31 49 N/A
O A..Z DIK_O 0x18 24 N/A
P A..Z DIK_P 0x19 25 N/A
Q A..Z DIK_Q 0x10 16 N/A
R A..Z DIK_R 0x13 19 N/A
S A..Z DIK_S 0x1F 31 N/A
T A..Z DIK_T 0x14 20 N/A
U A..Z DIK_U 0x16 22 N/A
V A..Z DIK_V 0x2F 47 N/A
W A..Z DIK_W 0x11 17 N/A
X A..Z DIK_X 0x2D 45 N/A
Y A..Z DIK_Y 0x15 21 N/A
Z A..Z DIK_Z 0x2C 44 N/A
Control Keys
Escape Control key DIK_ESCAPE 0x01 1 N/A
Tab Control key DIK_TAB 0x0F 15 N/A
Shift (left) Control key DIK_LSHIFT 0x2A 42 N/A
Shift (right) Control key DIK_RSHIFT 0x36 54 N/A
Control (left) Control key DIK_LCONTROL 0x1D 29 N/A
Control (right) Control key DIK_RCONTROL 0x9D 157 N/A
Backspace Control key DIK_BACK 0x0E 14 N/A
Control key DIK_BACKSPACE DIK_BACK N/A
Enter (main) Control key DIK_RETURN 0x1C 28 N/A
Enter (numpad) Control key DIK_NUMPADENTER 0x9C 156 N/A
Alt (left) Control key DIK_LMENU 0x38 56 N/A
Control key DIK_LALT DIK_LMENU N/A
Control key DIK_SPACE 0x39 57 N/A
Caps lock Control key DIK_CAPITAL 0x3A 58 N/A
Caps lock Control key DIK_CAPSLOCK DIK_CAPITAL N/A
Num lock (numpad) Control key DIK_NUMLOCK 0x45 69 N/A
Scroll lock Control key DIK_SCROLL 0x46 70 N/A
Menu button Control key DIK_RMENU 0xB8 184 N/A
Alt (right) Control key DIK_RALT DIK_RMENU N/A
CTRL (left, right) Control key INPUT_CTRL_OFFSET N/A 512 N/A
SHIFT (left, right) Control key INPUT_SHIFT_OFFSET N/A 1024 N/A
ALT (left, right) Control key INPUT_ALT_OFFSET N/A 2048 N/A
Symbol Keys
Graphics DIK_AT 0x91 145 NEC PC98
Graphics DIK_COLON 0x92 146 NEC PC98
Graphics DIK_UNDERLINE 0x93 147 NEC PC98
Minus (on main keyboard) Graphics DIK_MINUS 0x0C 12 N/A
Graphics DIK_EQUALS 0x0D 13 N/A
Graphics DIK_LBRACKET 0x1A 26 N/A
Graphics DIK_RBRACKET 0x1B 27 N/A
Semicolon Graphics DIK_SEMICOLON 0x27 39 N/A
Apostrophe Graphics DIK_APOSTROPHE 0x28 40 N/A
Accent grave Graphics DIK_GRAVE 0x29 41 N/A
Backslash Graphics DIK_BACKSLASH 0x2B 43 N/A
Comma Graphics DIK_COMMA 0x33 51 N/A
Period (main) Graphics DIK_PERIOD 0x34 52 N/A
Slash (main) Graphics DIK_SLASH 0x35 53 N/A
* (numpad) Graphics DIK_MULTIPLY 0x37 55 N/A
* (numpad) Graphics DIK_NUMPADSTAR DIK_MULTIPLY N/A
- (numpad) Graphics DIK_SUBTRACT 0x4A 74 N/A
+ (numpad) Graphics DIK_ADD 0x4E 78 N/A
. (numpad) Graphics DIK_DECIMAL 0x53 83 N/A
= (numpad) Graphics DIK_NUMPADEQUALS 0x8D 141 NEC PC98
- (numpad) Graphics DIK_NUMPADMINUS DIK_SUBTRACT N/A
+ (numpad) Graphics DIK_NUMPADPLUS DIK_ADD N/A
. (numpad) Graphics DIK_NUMPADPERIOD DIK_DECIMAL N/A
/ (numpad) Graphics DIK_NUMPADSLASH DIK_DIVIDE N/A
KataKana Keys
KataKana DIK_KANA 0x70 112 Japanese keyboard
KataKana DIK_ABNT_C1 0x73 115 / ? on Portugese (Brazilian) keyboards
KataKana DIK_CONVERT 0x79 121 Japanese keyboard
KataKana DIK_NOCONVERT 0x7B 123 Japanese keyboard
KataKana DIK_YEN 0x7D 125 Japanese keyboard
KataKana DIK_OEM_102 0x56 86 on UK/Germany keyboards
KataKana DIK_ABNT_C2 0x7E 126 Numpad . on Portugese (Brazilian) keyboards
KataKana DIK_PREVTRACK 0x90 144 Previous Track (DIK_CIRCUMFLEX on Japanese keyboard)
KataKana DIK_KANJI 0x94 148 Japanese keyboard
KataKana DIK_STOP 0x95 149 NEC PC98
KataKana DIK_AX 0x96 150 Japan AX
KataKana DIK_UNLABELED 0x97 151 J3100
KataKana DIK_NUMPADCOMMA 0xB3 179 , on numeric keypad - NEC PC98
KataKana DIK_CIRCUMFLEX DIK_PREVTRACK Japanese keyboard
App Keys
Apps DIK_NEXTTRACK 0x99 153 Next Track
Apps DIK_MUTE 0xA0 160 Mute
Apps DIK_CALCULATOR 0xA1 161 Calculator
Apps DIK_PLAYPAUSE 0xA2 162 Play / Pause
Apps DIK_MEDIASTOP 0xA4 164 Media Stop
Apps DIK_VOLUMEDOWN 0xAE 174 Volume -
Apps DIK_VOLUMEUP 0xB0 176 Volume +
Apps DIK_WEBHOME 0xB2 178 Web home
Apps DIK_SYSRQ 0xB7 183 N/A
Apps DIK_PAUSE 0xC5 197 Pause
Apps DIK_APPS 0xDD 221 AppMenu key
Apps DIK_POWER 0xDE 222 System Power
Apps DIK_SLEEP 0xDF 223 System Sleep
Apps DIK_WAKE 0xE3 227 System Wake
Apps DIK_WEBSEARCH 0xE5 229 Web Search
Apps DIK_WEBFAVORITES 0xE6 230 Web Favorites
Apps DIK_WEBREFRESH 0xE7 231 Web Refresh
Apps DIK_WEBSTOP 0xE8 232 Web Stop
Apps DIK_WEBFORWARD 0xE9 233 Web Forward
Apps DIK_WEBBACK 0xEA 234 Web Back
Apps DIK_MYCOMPUTER 0xEB 235 My Computer
Apps DIK_MAIL 0xEC 236 Mail
Apps DIK_MEDIASELECT 0xED 237 Media Select
Arrow Keypad
ArrowKeypad DIK_HOME 0xC7 199 Home on arrow keypad
ArrowKeypad DIK_UP 0xC8 200 UpArrow on arrow keypad
ArrowKeypad DIK_PRIOR 0xC9 201 PgUp on arrow keypad
ArrowKeypad DIK_LEFT 0xCB 203 LeftArrow on arrow keypad
ArrowKeypad DIK_RIGHT 0xCD 205 RightArrow on arrow keypad
ArrowKeypad DIK_END 0xCF 207 End on arrow keypad
ArrowKeypad DIK_DOWN 0xD0 208 DownArrow on arrow keypad
ArrowKeypad DIK_NEXT 0xD1 209 PgDn on arrow keypad
ArrowKeypad DIK_INSERT 0xD2 210 Insert on arrow keypad
ArrowKeypad DIK_DELETE 0xD3 211 Delete on arrow keypad
ArrowKeypad DIK_UPARROW DIK_UP UpArrow on arrow keypad
ArrowKeypad DIK_PGUP DIK_PRIOR PgUp on arrow keypad
ArrowKeypad DIK_LEFTARROW DIK_LEFT LeftArrow on arrow keypad
ArrowKeypad DIK_RIGHTARROW DIK_RIGHT RightArrow on arrow keypad
ArrowKeypad DIK_DOWNARROW DIK_DOWN DownArrow on arrow keypad
ArrowKeypad DIK_PGDN DIK_NEXT PgDn on arrow keypad
Other Keys
OS key (left) Other DIK_LWIN 0xDB 219 Left Windows key
OS key (right) Other DIK_RWIN 0xDC 220 Right Windows key


German Keyboard

Number Key Name Number Key Name Number Key Name
1 ESC 11 0 21 Z
2 1 12 ß 22 U
3 2 13 ´ 23 I
4 3 14 BACKSPACE 24 O
5 4 15 TAB 25 P
6 5 16 Q 26 Ü
7 6 17 W
8 7 18 E 28 ENTER
9 8 19 R 29 STRGL
10 9 20 T 30 A
31 S 41 ^ 51 ,
32 D 42 SHIFTL 52 .
33 F 43 # 53 -
34 G 44 Y 54 SHIFTR
35 H 45 X 55 NUM_*
36 J 46 C 56 ALT
37 K 47 V 57 SPACE
38 L 48 B 58 CAPS
39 Ö 49 N 59 F1
40 Ä 50 M 60 F2
61 F3 71 NUM_7 81 NUM_3
62 F4 72 NUM_8 82 NUM_0
63 F5 73 NUM_9 83 NUM_,
64 F6 74 NUM_-
65 F7 75 NUM_4
66 F8 76 NUM_5 86 <
67 F9 77 NUM_6 87 F11
68 F10 78 NUM_+ 88 F12
69 NUM 79 NUM_1
70 SCROLL 80 NUM_2
156 NUM_ENTER 200 UP 211 DELETE
157 STRGR 201 PAGEUP 219 WINR
220 WINL
181 NUM_/ 203 LEFT 221 APP
183 PRINT
184 ALTGR 205 RIGHT NOT DEFINED +
197 PAUSE 207 END
199 POS1 208 DOWN
209 PAGEDOWN
210 INSERT


French Keyboard

Number Key Name Number Key Name Number Key Name
1 ESC 11 0 21 Y
2 1 12 ) 22 U
3 2 13 = 23 I
4 3 14 BACKSPACE 24 O
5 4 15 TAB 25 P
6 5 16 A 26 ^
7 6 17 Z 27 $
8 7 18 E 28 ENTER
9 8 19 R 29 CTRLG
10 9 20 T 30 Q
31 S 41 ² 51 ;
32 D 42 SHIFTL 52 :
33 F 43 * 53 !
34 G 44 W 54 SHIFTR
35 H 45 X 55 NUM_*
36 J 46 C 56 ALT
37 K 47 V 57 SPACE
38 L 48 B 58 CAPS
39 M 49 N 59 F1
40 ù 50 , 60 F2
61 F3 71 NUM_7 81 NUM_3
62 F4 72 NUM_8 82 NUM_0
63 F5 73 NUM_9 83 NUM_.
64 F6 74 NUM_-
65 F7 75 NUM_4
66 F8 76 NUM_5 86 <
67 F9 77 NUM_6 87 F11
68 F10 78 NUM_+ 88 F12
69 NUM 79 NUM_1
70 SCROLL 80 NUM_2
156 NUM_ENTER 200 UP 211 DELETE
157 CTRLR 201 PAGEUP 219 WINR
220 WINL
181 NUM_/ 203 LEFT 221 APP
183 PRINT
184 ALTGR 205 RIGHT NOT DEFINED +
197 PAUSE 207 END
199 POS1 208 DOWN
209 PAGEDOWN
210 INSERT