Difference between revisions of "DirectX Scan Codes"

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search
imported>Qazaaq
(Moved page contributed by Shavkacagarikia)
 
imported>Google0013
(Update with more valid keycodes)
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
<source lang="html4strict">Button Dec
A scan code is a number assigned to each key on a keyboard. A keyboard reports which keys have been pressed by sending this code to the computer.
Escape  27
 
Q  81
<source lang="html4strict">Button         Dec
W  87
BACKSPACE      8
E  69
TAB            9
R  82
ENTER          13
T  84
CAPS LOCK      20
Y  89
ESCAPE          27
U  85
SPACE          32
I  73
PGUP            33
O  79
PGDOWN          34
P  80
END            35
TAB  9
HOME            36
ENTER  13
LEFT            37
A 65
UP              38
S  83
RIGHT          39
D 68
DOWN            40
F 70
DELETE          46
G 71
0              48
H 72
1              49
J 74
2              50
K 75
3              51
L 76
4              52
;  186
5              53
Z 90
6              54
V  86
7              55
B  66 
8              56
N  78
9               57
M  77
A               65
,  188
B              66
. 190
C              67
/ 191
D               68
L-SHIFT 160
E              69
R-SHIFT 161
F               70
SPACE  32
G               71
L-ALT 164
H               72
R-ALT 165
I              73
L-CTRL  162
J               74
R-CTRL  163
K               75
49
L               76
50
M              77
51
N              78
52
O              79
53
P              80
54
Q              81
55
R              82
56
S              83
57
T              84
0  48
U              85
-  189
V              86
= 187
W              87
BACKSPACE  8
X              88
UP  38
Y              89
LEFT  37
Z               90
DOWN  40
SUPER          92
RIGHT  39
Num0            96
DELETE  46
Num1            97
END  35
Num2            98
PGDOWN  34
Num3            99
PGUP  33
Num4            100
HOME  36
Num5            101
Num0  96
Num6            102
Num1  97
Num7            103
Num2  98
Num8            104
Num3  99
Num9            105
Num4  100
Num*            106
Num5  101
Num+            107
Num6  102
Num-            109
Num7  103
Num.           110
Num8  104
Num/           111
Num9  105
F1              112
Num.  110
F2              113
NumENTER  13
F3              114
Num+  107
F4              115
Num-  109
F5              116
Num*  106
F6              117
Num/  111
F7              118
F1 112
F8              119
F2 113
F9              120
F3 114
F10            121
F4 115
F11            122
F5 116
NUMLOCK        144
F6 117
SCRLOCK        145
F7 118
L-SHIFT         160
F8 119
R-SHIFT         161
F9 120
L-CTRL          162
F10 121
R-CTRL          163
F11 122
L-ALT           164
R-ALT           165
;              186
=              187
,              188
-               189
.              190
/              191
[              219
\              220
]              221
'              222
\              226
Mouse1          256
Mouse2          257
Mouse3          258
Mouse4          259
Mouse5          260
</source>
 
 
== Snippets==
<source lang="papyrus">
 
Group KeyCodes
    int Property Backspace = 8 AutoReadOnly
    int Property Tab = 9 AutoReadOnly
    int Property Enter = 13 AutoReadOnly
    int Property CapsLock = 20 AutoReadOnly
    int Property Escape = 27 AutoReadOnly
    int Property Space = 32 AutoReadOnly
    int Property PageUp = 33 AutoReadOnly
    int Property PageDown = 34 AutoReadOnly
    int Property End = 35 AutoReadOnly
    int Property Home = 36 AutoReadOnly
    int Property Left = 37 AutoReadOnly
    int Property Up = 38 AutoReadOnly
    int Property Right = 39 AutoReadOnly
    int Property Down = 40 AutoReadOnly
    int Property Delete = 46 AutoReadOnly
    int Property Number0 = 48 AutoReadOnly
    int Property Number1 = 49 AutoReadOnly
    int Property Number2 = 50 AutoReadOnly
    int Property Number3 = 51 AutoReadOnly
    int Property Number4 = 52 AutoReadOnly
    int Property Number5 = 53 AutoReadOnly
    int Property Number6 = 54 AutoReadOnly
    int Property Number7 = 55 AutoReadOnly
    int Property Number8 = 56 AutoReadOnly
    int Property Number9 = 57 AutoReadOnly
    int Property A = 65 AutoReadOnly
    int Property B = 66 AutoReadOnly
    int Property C = 67 AutoReadOnly
    int Property D = 68 AutoReadOnly
    int Property E = 69 AutoReadOnly
    int Property F = 70 AutoReadOnly
    int Property G = 71 AutoReadOnly
    int Property H = 72 AutoReadOnly
    int Property I = 73 AutoReadOnly
    int Property J = 74 AutoReadOnly
    int Property K = 75 AutoReadOnly
    int Property L = 76 AutoReadOnly
    int Property M = 77 AutoReadOnly
    int Property N = 78 AutoReadOnly
    int Property O = 79 AutoReadOnly
    int Property P = 80 AutoReadOnly
    int Property Q = 81 AutoReadOnly
    int Property R = 82 AutoReadOnly
    int Property S = 83 AutoReadOnly
    int Property T = 84 AutoReadOnly
    int Property U = 85 AutoReadOnly
    int Property V = 86 AutoReadOnly
    int Property W = 87 AutoReadOnly
    int Property X = 88 AutoReadOnly
    int Property Y = 89 AutoReadOnly
    int Property Z = 90 AutoReadOnly
    int Property Super = 92 AutoReadOnly
    int Property NumPad0 = 96 AutoReadOnly
    int Property NumPad1 = 97 AutoReadOnly
    int Property NumPad2 = 98 AutoReadOnly
    int Property NumPad3 = 99 AutoReadOnly
    int Property NumPad4 = 100 AutoReadOnly
    int Property NumPad5 = 101 AutoReadOnly
    int Property NumPad6 = 102 AutoReadOnly
    int Property NumPad7 = 103 AutoReadOnly
    int Property NumPad8 = 104 AutoReadOnly
    int Property NumPad9 = 105 AutoReadOnly
    int Property NumPadAsterisk = 106 AutoReadOnly
    int Property NumPadPlus = 107 AutoReadOnly
    int Property NumPadMinus = 109 AutoReadOnly
    int Property NumPadPeriod = 110 AutoReadOnly
    int Property NumPadFowardSlash = 111 AutoReadOnly
    int Property F1 = 112 AutoReadOnly
    int Property F2 = 113 AutoReadOnly
    int Property F3 = 114 AutoReadOnly
    int Property F4 = 115 AutoReadOnly
    int Property F5 = 116 AutoReadOnly
    int Property F6 = 117 AutoReadOnly
    int Property F7 = 118 AutoReadOnly
    int Property F8 = 119 AutoReadOnly
    int Property F9 = 120 AutoReadOnly
    int Property F10 = 121 AutoReadOnly
    int Property F11 = 122 AutoReadOnly
    int Property NumLock = 144 AutoReadOnly
    int Property ScrLock = 145 AutoReadOnly
    int Property LShift = 160 AutoReadOnly
    int Property RShift = 161 AutoReadOnly
    int Property LCtrl = 162 AutoReadOnly
    int Property RCrtl = 163 AutoReadOnly
    int Property LAlt = 164 AutoReadOnly
    int Property RAlt = 165 AutoReadOnly
    int Property SemiColon = 186 AutoReadOnly
    int Property Equals = 187 AutoReadOnly
    int Property Comma = 188 AutoReadOnly
    int Property Minus = 189 AutoReadOnly
    int Property Period = 190 AutoReadOnly
    int Property ForwardSlash = 191 AutoReadOnly
    int Property LeftBracket = 219 AutoReadOnly
    int Property BackwardSlash01 = 220 AutoReadOnly
    int Property RightBracket = 221 AutoReadOnly
    int Property Apostrophe = 222 AutoReadOnly
    int Property BackwardSlash02 = 226 AutoReadOnly
    int Property Mouse1 = 256 AutoReadOnly
    int Property Mouse2 = 257 AutoReadOnly
    int Property Mouse3 = 258 AutoReadOnly
    int Property Mouse4 = 259 AutoReadOnly
    int Property Mouse5 = 260 AutoReadOnly
EndGroup
 
</source>
</source>


== Notes ==
== Notes ==
*It seems that some keys don't fire if they are used by game, such as L-Alt and L-Ctrl. (They must be unused by control scheme).
*It seems that some keys don't fire if they are used by game, such as L-Alt and L-Ctrl. (They must be unused by control scheme).


== See Also ==
== See Also ==
*[[RegisterForKey - ScriptObject]]
*[[RegisterForKey - ScriptObject]]
*[[UnregisterForKey - ScriptObject]]
*[[OnKeyDown - ScriptObject]]
*[[OnKeyDown - ScriptObject]]
*[[OnKeyUp - ScriptObject]]
*[[OnKeyUp - ScriptObject]]
[[Category:Scripting]]
[[Category:Cheat Sheets]]

Latest revision as of 22:16, 12 August 2017

A scan code is a number assigned to each key on a keyboard. A keyboard reports which keys have been pressed by sending this code to the computer.

Button          Dec
BACKSPACE       8
TAB             9
ENTER           13
CAPS LOCK       20
ESCAPE          27
SPACE           32
PGUP            33
PGDOWN          34
END             35
HOME            36
LEFT            37
UP              38
RIGHT           39
DOWN            40
DELETE          46
0               48
1               49
2               50
3               51
4               52
5               53
6               54
7               55
8               56
9               57
A               65
B               66
C               67
D               68
E               69
F               70
G               71
H               72
I               73
J               74
K               75
L               76
M               77
N               78
O               79
P               80
Q               81
R               82
S               83
T               84
U               85
V               86
W               87
X               88
Y               89
Z               90
SUPER           92
Num0            96
Num1            97
Num2            98
Num3            99
Num4            100
Num5            101
Num6            102
Num7            103
Num8            104
Num9            105
Num*            106
Num+            107
Num-            109
Num.            110
Num/            111
F1              112
F2              113
F3              114
F4              115
F5              116
F6              117
F7              118
F8              119
F9              120
F10             121
F11             122
NUMLOCK         144
SCRLOCK         145
L-SHIFT         160
R-SHIFT         161
L-CTRL          162
R-CTRL          163
L-ALT           164
R-ALT           165
;               186
=               187
,               188
-               189
.               190
/               191
[               219
\               220
]               221
'               222
\               226
Mouse1          256
Mouse2          257
Mouse3          258
Mouse4          259
Mouse5          260


Snippets[edit | edit source]

Group KeyCodes
    int Property Backspace = 8 AutoReadOnly
    int Property Tab = 9 AutoReadOnly
    int Property Enter = 13 AutoReadOnly
    int Property CapsLock = 20 AutoReadOnly
    int Property Escape = 27 AutoReadOnly
    int Property Space = 32 AutoReadOnly
    int Property PageUp = 33 AutoReadOnly
    int Property PageDown = 34 AutoReadOnly
    int Property End = 35 AutoReadOnly
    int Property Home = 36 AutoReadOnly
    int Property Left = 37 AutoReadOnly
    int Property Up = 38 AutoReadOnly
    int Property Right = 39 AutoReadOnly
    int Property Down = 40 AutoReadOnly
    int Property Delete = 46 AutoReadOnly
    int Property Number0 = 48 AutoReadOnly
    int Property Number1 = 49 AutoReadOnly
    int Property Number2 = 50 AutoReadOnly
    int Property Number3 = 51 AutoReadOnly
    int Property Number4 = 52 AutoReadOnly
    int Property Number5 = 53 AutoReadOnly
    int Property Number6 = 54 AutoReadOnly
    int Property Number7 = 55 AutoReadOnly
    int Property Number8 = 56 AutoReadOnly
    int Property Number9 = 57 AutoReadOnly
    int Property A = 65 AutoReadOnly
    int Property B = 66 AutoReadOnly
    int Property C = 67 AutoReadOnly
    int Property D = 68 AutoReadOnly
    int Property E = 69 AutoReadOnly
    int Property F = 70 AutoReadOnly
    int Property G = 71 AutoReadOnly
    int Property H = 72 AutoReadOnly
    int Property I = 73 AutoReadOnly
    int Property J = 74 AutoReadOnly
    int Property K = 75 AutoReadOnly
    int Property L = 76 AutoReadOnly
    int Property M = 77 AutoReadOnly
    int Property N = 78 AutoReadOnly
    int Property O = 79 AutoReadOnly
    int Property P = 80 AutoReadOnly
    int Property Q = 81 AutoReadOnly
    int Property R = 82 AutoReadOnly
    int Property S = 83 AutoReadOnly
    int Property T = 84 AutoReadOnly
    int Property U = 85 AutoReadOnly
    int Property V = 86 AutoReadOnly
    int Property W = 87 AutoReadOnly
    int Property X = 88 AutoReadOnly
    int Property Y = 89 AutoReadOnly
    int Property Z = 90 AutoReadOnly
    int Property Super = 92 AutoReadOnly
    int Property NumPad0 = 96 AutoReadOnly
    int Property NumPad1 = 97 AutoReadOnly
    int Property NumPad2 = 98 AutoReadOnly
    int Property NumPad3 = 99 AutoReadOnly
    int Property NumPad4 = 100 AutoReadOnly
    int Property NumPad5 = 101 AutoReadOnly
    int Property NumPad6 = 102 AutoReadOnly
    int Property NumPad7 = 103 AutoReadOnly
    int Property NumPad8 = 104 AutoReadOnly
    int Property NumPad9 = 105 AutoReadOnly
    int Property NumPadAsterisk = 106 AutoReadOnly
    int Property NumPadPlus = 107 AutoReadOnly
    int Property NumPadMinus = 109 AutoReadOnly
    int Property NumPadPeriod = 110 AutoReadOnly
    int Property NumPadFowardSlash = 111 AutoReadOnly
    int Property F1 = 112 AutoReadOnly
    int Property F2 = 113 AutoReadOnly
    int Property F3 = 114 AutoReadOnly
    int Property F4 = 115 AutoReadOnly
    int Property F5 = 116 AutoReadOnly
    int Property F6 = 117 AutoReadOnly
    int Property F7 = 118 AutoReadOnly
    int Property F8 = 119 AutoReadOnly
    int Property F9 = 120 AutoReadOnly
    int Property F10 = 121 AutoReadOnly
    int Property F11 = 122 AutoReadOnly
    int Property NumLock = 144 AutoReadOnly
    int Property ScrLock = 145 AutoReadOnly
    int Property LShift = 160 AutoReadOnly
    int Property RShift = 161 AutoReadOnly
    int Property LCtrl = 162 AutoReadOnly
    int Property RCrtl = 163 AutoReadOnly
    int Property LAlt = 164 AutoReadOnly
    int Property RAlt = 165 AutoReadOnly
    int Property SemiColon = 186 AutoReadOnly
    int Property Equals = 187 AutoReadOnly
    int Property Comma = 188 AutoReadOnly
    int Property Minus = 189 AutoReadOnly
    int Property Period = 190 AutoReadOnly
    int Property ForwardSlash = 191 AutoReadOnly
    int Property LeftBracket = 219 AutoReadOnly
    int Property BackwardSlash01 = 220 AutoReadOnly
    int Property RightBracket = 221 AutoReadOnly
    int Property Apostrophe = 222 AutoReadOnly
    int Property BackwardSlash02 = 226 AutoReadOnly
    int Property Mouse1 = 256 AutoReadOnly
    int Property Mouse2 = 257 AutoReadOnly
    int Property Mouse3 = 258 AutoReadOnly
    int Property Mouse4 = 259 AutoReadOnly
    int Property Mouse5 = 260 AutoReadOnly
EndGroup


Notes[edit | edit source]

  • It seems that some keys don't fire if they are used by game, such as L-Alt and L-Ctrl. (They must be unused by control scheme).


See Also[edit | edit source]