File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -4115,12 +4115,14 @@ extern "C" {
4115
4115
#define SDL_HINT_WINDOWS_GAMEINPUT "SDL_WINDOWS_GAMEINPUT"
4116
4116
4117
4117
/**
4118
- * A variable controlling whether raw keyboard events are used on Windows.
4118
+ * A variable controlling if and how raw keyboard events are used on Windows.
4119
4119
*
4120
4120
* The variable can be set to the following values:
4121
4121
*
4122
- * - "0": The Windows message loop is used for keyboard events. (default)
4123
- * - "1": Low latency raw keyboard events are used.
4122
+ * - "0": Raw keyboard events are not used (default)
4123
+ * - "1": Raw keyboard events are used.
4124
+ * - "2": Raw keyboard events are used, with RIDEV_NOHOTKEYS. (available since SDL 3.4.0)
4125
+ * - "2": Raw keyboard events are used, with RIDEV_NOHOTKEYS and RIDEV_APPKEYS. (available since SDL 3.4.0)
4124
4126
*
4125
4127
* This hint can be set anytime.
4126
4128
*
Original file line number Diff line number Diff line change @@ -78,6 +78,13 @@ static DWORD WINAPI WIN_RawInputThread(LPVOID param)
78
78
devices [count ].usUsagePage = USB_USAGEPAGE_GENERIC_DESKTOP ;
79
79
devices [count ].usUsage = USB_USAGE_GENERIC_KEYBOARD ;
80
80
devices [count ].dwFlags = 0 ;
81
+ int rawmode = 3 & SDL_atoi (SDL_GetHint (SDL_HINT_WINDOWS_RAW_KEYBOARD ));
82
+ if (rawmode > 1 ) {
83
+ devices [count ].dwFlags |= RIDEV_NOHOTKEYS ;
84
+ if (rawmode == 3 ) {
85
+ devices [count ].dwFlags |= RIDEV_APPKEYS ;
86
+ }
87
+ }
81
88
devices [count ].hwndTarget = window ;
82
89
++ count ;
83
90
}
You can’t perform that action at this time.
0 commit comments