Skip to content

Commit 587368b

Browse files
committed
Update SDL_keycode.inc to match SDL 3.2.20
1 parent b2102d5 commit 587368b

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

units/SDL3.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ interface
100100
{$I SDL_audio.inc} // 3.1.6-prev
101101
{$I SDL_sensor.inc} // 3.1.6-prev
102102
{$I SDL_scancode.inc} // 3.1.6-prev
103-
{$I SDL_keycode.inc} // 3.1.6-prev
103+
{$I SDL_keycode.inc} // 3.2.20
104104
{$I SDL_mouse.inc} // 3.1.6-prev
105105
{$I SDL_keyboard.inc} // 3.1.6-prev
106106
{$I SDL_joystick.inc} // 3.1.6-prev

units/SDL_keycode.inc

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
* # CategoryKeycode
1111
*
1212
* Defines constants which identify keyboard keys and modifiers.
13+
*
14+
* Please refer to the Best Keyboard Practices document for details on what
15+
* this information means and how best to use it.
16+
*
17+
* https://wiki.libsdl.org/SDL3/BestKeyboardPractices
1318
}
1419

1520
{*
@@ -23,14 +28,18 @@
2328
* A special exception is the number keys at the top of the keyboard which map
2429
* to SDLK_0...SDLK_9 on AZERTY layouts.
2530
*
26-
* \since This datatype is available since SDL 3.1.3.
31+
* Keys with the `SDLK_EXTENDED_MASK` bit set do not map to a scancode or
32+
* unicode code point.
33+
*
34+
* \since This datatype is available since SDL 3.2.0.
2735
}
2836
type
2937
PPSDL_Keycode = ^PSDL_Keycode;
3038
PSDL_Keycode = ^TSDL_Keycode;
3139
TSDL_Keycode = type cuint32;
3240

3341
const
42+
SDLK_EXTENDED_MASK = 1 shl 29;
3443
SDLK_SCANCODE_MASK = 1 shl 30;
3544
function SDL_SCANCODE_TO_KEYCODE(X: TSDL_Scancode): TSDL_Keycode; {SDL3-for-Pascal: C Macro}
3645
const
@@ -283,11 +292,18 @@ const
283292
SDLK_SOFTRIGHT = TSDL_Keycode($40000120); {*< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTRIGHT) }
284293
SDLK_CALL = TSDL_Keycode($40000121); {*< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALL) }
285294
SDLK_ENDCALL = TSDL_Keycode($40000122); {*< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ENDCALL) }
295+
SDLK_LEFT_TAB = TSDL_Keycode($20000001); {*< Extended key Left Tab }
296+
SDLK_LEVEL5_SHIFT = TSDL_Keycode($20000002); {*< Extended key Level 5 Shift }
297+
SDLK_MULTI_KEY_COMPOSE = TSDL_Keycode($20000003); {*< Extended key Multi-key Compose }
298+
SDLK_LMETA = TSDL_Keycode($20000004); {*< Extended key Left Meta }
299+
SDLK_RMETA = TSDL_Keycode($20000005); {*< Extended key Right Meta }
300+
SDLK_LHYPER = TSDL_Keycode($20000006); {*< Extended key Left Hyper }
301+
SDLK_RHYPER = TSDL_Keycode($20000007); {*< Extended key Right Hyper }
286302

287303
{*
288304
* Valid key modifiers (possibly OR'd together).
289305
*
290-
* \since This datatype is available since SDL 3.1.3.
306+
* \since This datatype is available since SDL 3.2.0.
291307
}
292308
type
293309
PPSDL_Keymod = ^PSDL_Keymod;
@@ -298,6 +314,7 @@ const
298314
SDL_KMOD_NONE = TSDL_Keymod($0000); {*< no modifier is applicable. }
299315
SDL_KMOD_LSHIFT = TSDL_Keymod($0001); {*< the left Shift key is down. }
300316
SDL_KMOD_RSHIFT = TSDL_Keymod($0002); {*< the right Shift key is down. }
317+
SDL_KMOD_LEVEL5 = TSDL_Keymod($0004); {*< the Level 5 Shift key is down. }
301318
SDL_KMOD_LCTRL = TSDL_Keymod($0040); {*< the left Ctrl (Control) key is down. }
302319
SDL_KMOD_RCTRL = TSDL_Keymod($0080); {*< the right Ctrl (Control) key is down. }
303320
SDL_KMOD_LALT = TSDL_Keymod($0100); {*< the left Alt key is down. }

0 commit comments

Comments
 (0)