Smooth Motion Factory
Understanding DirectInput (DXScanCode) Keycodes for Modding 본문
Understanding DirectInput (DXScanCode) Keycodes for Modding
Smooth Motion 2025. 12. 6. 21:21Understanding DirectX / DirectInput (DXScanCode) Keycodes for Modding
When creating or customizing Skyrim mods, you will often need to set or change hotkeys inside an .ini file. These configuration files commonly use a format called DXScanCode — a numeric keycode system originating from Microsoft’s DirectX (DirectInput) API.
This post summarizes what DXScanCodes are, how they relate to Skyrim’s Input Script system, and why modders frequently use them. The information is based on general DirectInput documentation and the key list provided on the CK Wiki’s Input Script page (Skyrim Creation Kit API reference).
What Are DXScanCodes?
DXScanCodes (DirectInput Scan Codes) are numerical identifiers assigned to keyboard keys at a hardware level. They do not represent characters but the physical key positions on a standard keyboard layout.
Because they represent physical keys, DXScanCodes remain consistent regardless of:
- Keyboard layout (QWERTY, AZERTY, Dvorak, etc.)
- Language settings
- System locale
This hardware-level consistency is the reason Skyrim and many other games use DXScanCodes instead of ASCII or virtual-key codes when handling key inputs.
DirectX vs General Programming Keycodes
A common misunderstanding is that DXScanCodes are universal across all programming languages. They are not. Different systems use different keycode standards:
- DirectInput Scan Codes (DXScanCode)
- Windows Virtual-Key Codes (VK_*)
- USB HID Usage Codes
- SDL Scancodes
- Web Key Events (JavaScript keyCode)
Among these, DXScanCodes are mainly used in:
- DirectX / DirectInput-based games
- Older engines and modding frameworks (Skyrim, Oblivion, Fallout New Vegas, etc.)
- Game input libraries that rely directly on scancode values
Thus, DXScanCodes are not a universal standard, but they are widely used in Windows game modding.
DXScanCodes in Skyrim Modding
Skyrim exposes DXScanCodes through its Input Script system, which modders can reference inside .ini files or Papyrus scripts that listen for key input. The CK Wiki contains a list of these codes, such as:
- 1 = ESC
- 2 = 1 key
- 28 = Enter
- 42 = Left Shift
- 57 = Space Bar
These values allow modders to create consistent hotkey systems that work on all keyboard layouts.
Why Skyrim Uses DXScanCodes
Skyrim’s engine (Gamebryo/Creation Engine) was originally built during the DirectInput era. DXScanCodes provide:
- Stable hardware-level key detection
- Independence from keyboard language
- Guaranteed behavior even when mods alter input logic
Because of this, nearly all Skyrim hotkey mods — MCM menus, INI-based hotkeys, parry mechanics, dodge mechanics, behavior scripts — use DXScanCodes instead of other keycodes.
Examples of DXScanCodes in INI Files
; Dodge hotkey example
DodgeKey = 42 ; Left Shift
; Parry hotkey example
ParryKey = 57 ; Space bar
; Custom hotkey
MyHotkey = 19 ; R key
Once you know the DXScanCode values, customizing your controls becomes far easier.
Conclusion
DXScanCodes are a DirectInput-based keyboard identification system widely used in Skyrim modding due to their stability and layout independence. Understanding these codes allows modders to reliably configure hotkeys and ensure their mods behave predictably across different systems.
DXScanCode Key Table (DirectInput Scan Codes)
DXScanCodes are hardware-level DirectInput key codes used by games like Skyrim for stable hotkey handling regardless of keyboard layout or language settings. Use this table as a reference when setting hotkeys in INI files or SKSE plugins.
DXScanCode Key Table (Hex / Dec / Button)
| Hex | Dec | Button |
|---|---|---|
| 0x01 | 1 | Escape |
| 0x02 | 2 | 1 |
| 0x03 | 3 | 2 |
| 0x04 | 4 | 3 |
| 0x05 | 5 | 4 |
| 0x06 | 6 | 5 |
| 0x07 | 7 | 6 |
| 0x08 | 8 | 7 |
| 0x09 | 9 | 8 |
| 0x0A | 10 | 9 |
| 0x0B | 11 | 0 |
| 0x0C | 12 | Minus |
| 0x0D | 13 | Equals |
| 0x0E | 14 | Backspace |
| 0x0F | 15 | Tab |
| 0x10 | 16 | Q |
| 0x11 | 17 | W |
| 0x12 | 18 | E |
| 0x13 | 19 | R |
| 0x14 | 20 | T |
| 0x15 | 21 | Y |
| 0x16 | 22 | U |
| 0x17 | 23 | I |
| 0x18 | 24 | O |
| 0x19 | 25 | P |
| 0x1A | 26 | Left Bracket |
| 0x1B | 27 | Right Bracket |
| 0x1C | 28 | Enter |
| 0x1D | 29 | Left Control |
| 0x1E | 30 | A |
| 0x1F | 31 | S |
| 0x20 | 32 | D |
| 0x21 | 33 | F |
| 0x22 | 34 | G |
| 0x23 | 35 | H |
| 0x24 | 36 | J |
| 0x25 | 37 | K |
| 0x26 | 38 | L |
| 0x27 | 39 | Semicolon |
| 0x28 | 40 | Apostrophe |
| 0x29 | 41 | ~ (Console) |
| 0x2A | 42 | Left Shift |
| 0x2B | 43 | Back Slash |
| 0x2C | 44 | Z |
| 0x2D | 45 | X |
| 0x2E | 46 | C |
| 0x2F | 47 | V |
| 0x30 | 48 | B |
| 0x31 | 49 | N |
| 0x32 | 50 | M |
| 0x33 | 51 | Comma |
| 0x34 | 52 | Period |
| 0x35 | 53 | Forward Slash |
| 0x36 | 54 | Right Shift |
| 0x37 | 55 | NUM* |
| 0x38 | 56 | Left Alt |
| 0x39 | 57 | Spacebar |
| 0x3A | 58 | Caps Lock |
| 0x3B | 59 | F1 |
| 0x3C | 60 | F2 |
| 0x3D | 61 | F3 |
| 0x3E | 62 | F4 |
| 0x3F | 63 | F5 |
| 0x40 | 64 | F6 |
| 0x41 | 65 | F7 |
| 0x42 | 66 | F8 |
| 0x43 | 67 | F9 |
| 0x44 | 68 | F10 |
| 0x45 | 69 | Num Lock |
| 0x46 | 70 | Scroll Lock |
| 0x47 | 71 | NUM7 |
| 0x48 | 72 | NUM8 |
| 0x49 | 73 | NUM9 |
| 0x4A | 74 | NUM- |
| 0x4B | 75 | NUM4 |
| 0x4C | 76 | NUM5 |
| 0x4D | 77 | NUM6 |
| 0x4E | 78 | NUM+ |
| 0x4F | 79 | NUM1 |
| 0x50 | 80 | NUM2 |
| 0x51 | 81 | NUM3 |
| 0x52 | 82 | NUM0 |
| 0x53 | 83 | NUM. |
| 0x57 | 87 | F11 |
| 0x58 | 88 | F12 |
| 0x9C | 156 | NUM Enter |
| 0x9D | 157 | Right Control |
| 0xB5 | 181 | NUM/ |
| 0xB7 | 183 | SysRq / PtrScr |
| 0xB8 | 184 | Right Alt |
| 0xC5 | 197 | Pause |
| 0xC7 | 199 | Home |
| 0xC8 | 200 | Up Arrow |
| 0xC9 | 201 | PgUp |
| 0xCB | 203 | Left Arrow |
| 0xCD | 205 | Right Arrow |
| 0xCF | 207 | End |
| 0xD0 | 208 | Down Arrow |
| 0xD1 | 209 | PgDown |
| 0xD2 | 210 | Insert |
| 0xD3 | 211 | Delete |
| 0x100 | 256 | Left Mouse Button |
| 0x101 | 257 | Right Mouse Button |
| 0x102 | 258 | Middle/Wheel Mouse Button |
| 0x103 | 259 | Mouse Button 3 |
| 0x104 | 260 | Mouse Button 4 |
| 0x105 | 261 | Mouse Button 5 |
| 0x106 | 262 | Mouse Button 6 |
| 0x107 | 263 | Mouse Button 7 |
| 0x108 | 264 | Mouse Wheel Up |
| 0x109 | 265 | Mouse Wheel Down |
| Supported GamePad Buttons | ||
| 0x10A | 266 | DPAD_UP |
| 0x10B | 267 | DPAD_DOWN |
| 0x10C | 268 | DPAD_LEFT |
| 0x10D | 269 | DPAD_RIGHT |
| 0x10E | 270 | START |
| 0x10F | 271 | BACK |
| 0x110 | 272 | LEFT_THUMB |
| 0x111 | 273 | RIGHT_THUMB |
| 0x112 | 274 | LEFT_SHOULDER |
| 0x113 | 275 | RIGHT_SHOULDER |
| 0x114 | 276 | A |
| 0x115 | 277 | B |
| 0x116 | 278 | X |
| 0x117 | 279 | Y |
| 0x118 | 280 | LT |
| 0x119 | 281 | RT |
모딩을 위한 DirectX / DirectInput (DXScanCode) 키코드 이해하기
스카이림 모드를 제작하거나 커스터마이즈할 때, 종종 .ini 파일 안에서 단축키를 설정하거나 변경해야 합니다. 이 설정 파일들은 보통 DXScanCode라는 형식을 사용하며, 이는 마이크로소프트 DirectX(DirectInput) API에서 비롯된 숫자 기반 키코드 시스템입니다.
이 글에서는 DXScanCode가 무엇인지, 스카이림의 Input Script 시스템과 어떻게 연결되는지, 그리고 왜 모더들이 자주 사용하는지 정리합니다. 내용은 일반적인 DirectInput 문서와 CK Wiki의 Input Script 페이지(스카이림 Creation Kit API 레퍼런스)에 제공된 키 목록을 기반으로 합니다.
DXScanCode란 무엇인가?
DXScanCode(DirectInput Scan Code)는 하드웨어 수준에서 각 키보드 키에 할당된 숫자 식별자입니다. 이 값은 문자 그 자체를 의미하는 것이 아니라, 표준 키보드 레이아웃에서의 물리적인 키 위치를 나타냅니다.
이 값들은 물리적인 키 위치를 기준으로 하기 때문에, 다음과는 무관하게 일정하게 유지됩니다.
- 키보드 레이아웃 (QWERTY, AZERTY, Dvorak 등)
- 언어 설정
- 시스템 로케일
이런 하드웨어 수준 일관성 덕분에, 스카이림을 포함한 많은 게임들이 키 입력을 처리할 때 ASCII나 가상 키코드 대신 DXScanCode를 사용합니다.
DirectX 키코드 vs 일반 프로그래밍 키코드
DXScanCode가 모든 프로그래밍 환경에서 공통으로 쓰이는 키코드라고 오해하는 경우가 있지만, 그렇지 않습니다. 환경마다 사용하는 키코드 규격이 다릅니다.
- DirectInput Scan Codes (DXScanCode)
- Windows Virtual-Key Codes (VK_*)
- USB HID Usage Codes
- SDL Scancodes
- 웹 키 이벤트 (JavaScript keyCode)
이 중 DXScanCode는 주로 다음과 같은 곳에서 사용됩니다.
- DirectX / DirectInput 기반 게임
- 스카이림, 오블리비언, 폴아웃: 뉴베가스 같은 구형 엔진 및 모딩 프레임워크
- 스캔코드 값을 직접 사용하는 게임 입력 라이브러리
따라서 DXScanCode는 범용 표준 키코드는 아니지만, 윈도우 기반 게임 모딩에서는 매우 널리 사용됩니다.
스카이림 모딩에서의 DXScanCode
스카이림은 Input Script 시스템을 통해 DXScanCode를 노출하며, 모더들은 이를 .ini 파일이나 키 입력을 감지하는 Papyrus 스크립트에서 참조할 수 있습니다. CK Wiki에는 예를 들어 다음과 같은 코드들이 정리되어 있습니다.
- 1 = ESC
- 2 = 1 키
- 28 = Enter
- 42 = Left Shift
- 57 = Space Bar
이 값들을 사용하면 어떤 키보드 레이아웃에서든 일관성 있게 동작하는 단축키 시스템을 만들 수 있습니다.
스카이림이 DXScanCode를 사용하는 이유
스카이림의 엔진(Gamebryo / Creation Engine)은 원래 DirectInput 시대에 설계되었습니다. DXScanCode는 다음과 같은 장점을 제공합니다.
- 하드웨어 수준에서 안정적인 키 감지
- 키보드 언어/레이아웃에 독립적
- 모드가 입력 로직을 변경해도 예측 가능한 동작 유지
이 때문에 대부분의 스카이림 핫키 관련 모드들 — MCM 메뉴, INI 기반 단축키, 패링/회피 메커니즘, 비헤이비어 스크립트 등 — 이 다른 키코드가 아닌 DXScanCode를 사용하는 것입니다.
INI 파일에서 DXScanCode 사용 예시
; 회피 단축키 예시
DodgeKey = 42 ; Left Shift
; 패링 단축키 예시
ParryKey = 57 ; Space bar
; 커스텀 단축키 예시
MyHotkey = 19 ; R key
한 번 DXScanCode 값에 익숙해지면, 컨트롤 커스터마이징이 훨씬 쉬워집니다.
정리 (Conclusion)
DXScanCode는 DirectInput 기반의 키보드 식별 시스템으로, 안정성과 레이아웃 독립성 때문에 스카이림 모딩에서 널리 사용됩니다. 이 코드를 이해하면 단축키를 신뢰성 있게 설정할 수 있고, 서로 다른 환경에서도 모드가 예측 가능하게 동작하도록 만들 수 있습니다.
DXScanCode Key Table (DirectInput Scan Codes)
DXScanCode는 스카이림 같은 게임에서 키보드 레이아웃이나 언어 설정과 무관하게 안정적으로 단축키를 처리하기 위해 사용되는 DirectInput 기반 키코드입니다. 아래 표는 INI 파일이나 SKSE 플러그인에서 단축키를 설정할 때 참고용으로 사용할 수 있는 DXScanCode 목록입니다.
DXScanCode Key Table (Hex / Dec / Button)
| Hex | Dec | Button |
|---|---|---|
| 0x01 | 1 | Escape |
| 0x02 | 2 | 1 |
| 0x03 | 3 | 2 |
| 0x04 | 4 | 3 |
| 0x05 | 5 | 4 |
| 0x06 | 6 | 5 |
| 0x07 | 7 | 6 |
| 0x08 | 8 | 7 |
| 0x09 | 9 | 8 |
| 0x0A | 10 | 9 |
| 0x0B | 11 | 0 |
| 0x0C | 12 | Minus |
| 0x0D | 13 | Equals |
| 0x0E | 14 | Backspace |
| 0x0F | 15 | Tab |
| 0x10 | 16 | Q |
| 0x11 | 17 | W |
| 0x12 | 18 | E |
| 0x13 | 19 | R |
| 0x14 | 20 | T |
| 0x15 | 21 | Y |
| 0x16 | 22 | U |
| 0x17 | 23 | I |
| 0x18 | 24 | O |
| 0x19 | 25 | P |
| 0x1A | 26 | Left Bracket |
| 0x1B | 27 | Right Bracket |
| 0x1C | 28 | Enter |
| 0x1D | 29 | Left Control |
| 0x1E | 30 | A |
| 0x1F | 31 | S |
| 0x20 | 32 | D |
| 0x21 | 33 | F |
| 0x22 | 34 | G |
| 0x23 | 35 | H |
| 0x24 | 36 | J |
| 0x25 | 37 | K |
| 0x26 | 38 | L |
| 0x27 | 39 | Semicolon |
| 0x28 | 40 | Apostrophe |
| 0x29 | 41 | ~ (Console) |
| 0x2A | 42 | Left Shift |
| 0x2B | 43 | Back Slash |
| 0x2C | 44 | Z |
| 0x2D | 45 | X |
| 0x2E | 46 | C |
| 0x2F | 47 | V |
| 0x30 | 48 | B |
| 0x31 | 49 | N |
| 0x32 | 50 | M |
| 0x33 | 51 | Comma |
| 0x34 | 52 | Period |
| 0x35 | 53 | Forward Slash |
| 0x36 | 54 | Right Shift |
| 0x37 | 55 | NUM* |
| 0x38 | 56 | Left Alt |
| 0x39 | 57 | Spacebar |
| 0x3A | 58 | Caps Lock |
| 0x3B | 59 | F1 |
| 0x3C | 60 | F2 |
| 0x3D | 61 | F3 |
| 0x3E | 62 | F4 |
| 0x3F | 63 | F5 |
| 0x40 | 64 | F6 |
| 0x41 | 65 | F7 |
| 0x42 | 66 | F8 |
| 0x43 | 67 | F9 |
| 0x44 | 68 | F10 |
| 0x45 | 69 | Num Lock |
| 0x46 | 70 | Scroll Lock |
| 0x47 | 71 | NUM7 |
| 0x48 | 72 | NUM8 |
| 0x49 | 73 | NUM9 |
| 0x4A | 74 | NUM- |
| 0x4B | 75 | NUM4 |
| 0x4C | 76 | NUM5 |
| 0x4D | 77 | NUM6 |
| 0x4E | 78 | NUM+ |
| 0x4F | 79 | NUM1 |
| 0x50 | 80 | NUM2 |
| 0x51 | 81 | NUM3 |
| 0x52 | 82 | NUM0 |
| 0x53 | 83 | NUM. |
| 0x57 | 87 | F11 |
| 0x58 | 88 | F12 |
| 0x9C | 156 | NUM Enter |
| 0x9D | 157 | Right Control |
| 0xB5 | 181 | NUM/ |
| 0xB7 | 183 | SysRq / PtrScr |
| 0xB8 | 184 | Right Alt |
| 0xC5 | 197 | Pause |
| 0xC7 | 199 | Home |
| 0xC8 | 200 | Up Arrow |
| 0xC9 | 201 | PgUp |
| 0xCB | 203 | Left Arrow |
| 0xCD | 205 | Right Arrow |
| 0xCF | 207 | End |
| 0xD0 | 208 | Down Arrow |
| 0xD1 | 209 | PgDown |
| 0xD2 | 210 | Insert |
| 0xD3 | 211 | Delete |
| 0x100 | 256 | Left Mouse Button |
| 0x101 | 257 | Right Mouse Button |
| 0x102 | 258 | Middle/Wheel Mouse Button |
| 0x103 | 259 | Mouse Button 3 |
| 0x104 | 260 | Mouse Button 4 |
| 0x105 | 261 | Mouse Button 5 |
| 0x106 | 262 | Mouse Button 6 |
| 0x107 | 263 | Mouse Button 7 |
| 0x108 | 264 | Mouse Wheel Up |
| 0x109 | 265 | Mouse Wheel Down |
| Supported GamePad Buttons | ||
| 0x10A | 266 | DPAD_UP |
| 0x10B | 267 | DPAD_DOWN |
| 0x10C | 268 | DPAD_LEFT |
| 0x10D | 269 | DPAD_RIGHT |
| 0x10E | 270 | START |
| 0x10F | 271 | BACK |
| 0x110 | 272 | LEFT_THUMB |
| 0x111 | 273 | RIGHT_THUMB |
| 0x112 | 274 | LEFT_SHOULDER |
| 0x113 | 275 | RIGHT_SHOULDER |
| 0x114 | 276 | A |
| 0x115 | 277 | B |
| 0x116 | 278 | X |
| 0x117 | 279 | Y |
| 0x118 | 280 | LT |
| 0x119 | 281 | RT |
'Modding' 카테고리의 다른 글
| Precautions when creating Skyrim locomotion (0) | 2025.12.05 |
|---|