File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -4115,12 +4115,13 @@ 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)
4124
4125
*
4125
4126
* This hint can be set anytime.
4126
4127
*
Original file line number Diff line number Diff line change @@ -78,6 +78,10 @@ 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 = SDL_GetStringInteger (SDL_GetHint (SDL_HINT_WINDOWS_RAW_KEYBOARD ), 0 );
82
+ if (rawmode == 2 ) {
83
+ devices [count ].dwFlags |= RIDEV_NOHOTKEYS ;
84
+ }
81
85
devices [count ].hwndTarget = window ;
82
86
++ count ;
83
87
}
You can’t perform that action at this time.
0 commit comments