|
|
@@ -34,6 +34,7 @@
|
|
|
|
|
|
#define ENABLE_RAW_MOUSE_INPUT 0x01
|
|
|
#define ENABLE_RAW_KEYBOARD_INPUT 0x02
|
|
|
+#define RAW_KEYBOARD_FLAG_NOHOTKEYS 0x04
|
|
|
|
|
|
typedef struct
|
|
|
{
|
|
|
@@ -81,6 +82,9 @@ static DWORD WINAPI WIN_RawInputThread(LPVOID param)
|
|
|
devices[count].usUsagePage = USB_USAGEPAGE_GENERIC_DESKTOP;
|
|
|
devices[count].usUsage = USB_USAGE_GENERIC_KEYBOARD;
|
|
|
devices[count].dwFlags = 0;
|
|
|
+ if (data->flags & RAW_KEYBOARD_FLAG_NOHOTKEYS) {
|
|
|
+ devices[count].dwFlags |= RIDEV_NOHOTKEYS;
|
|
|
+ }
|
|
|
devices[count].hwndTarget = window;
|
|
|
++count;
|
|
|
}
|
|
|
@@ -203,6 +207,9 @@ static bool WIN_UpdateRawInputEnabled(SDL_VideoDevice *_this)
|
|
|
}
|
|
|
if (data->raw_keyboard_enabled) {
|
|
|
flags |= ENABLE_RAW_KEYBOARD_INPUT;
|
|
|
+ if (data->raw_keyboard_flag_nohotkeys) {
|
|
|
+ flags |= RAW_KEYBOARD_FLAG_NOHOTKEYS;
|
|
|
+ }
|
|
|
}
|
|
|
if (flags != data->raw_input_enabled) {
|
|
|
if (WIN_SetRawInputEnabled(_this, flags)) {
|
|
|
@@ -250,6 +257,34 @@ bool WIN_SetRawKeyboardEnabled(SDL_VideoDevice *_this, bool enabled)
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+typedef enum WIN_RawKeyboardFlag {
|
|
|
+ NOHOTKEYS
|
|
|
+} WIN_RawKeyboardFlag;
|
|
|
+
|
|
|
+static bool WIN_SetRawKeyboardFlag(SDL_VideoDevice *_this, WIN_RawKeyboardFlag flag, bool enabled)
|
|
|
+{
|
|
|
+ SDL_VideoData *data = _this->internal;
|
|
|
+
|
|
|
+ switch(flag) {
|
|
|
+ case NOHOTKEYS:
|
|
|
+ data->raw_keyboard_flag_nohotkeys = enabled;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (data->gameinput_context) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return WIN_UpdateRawInputEnabled(_this);
|
|
|
+}
|
|
|
+
|
|
|
+bool WIN_SetRawKeyboardFlag_NoHotkeys(SDL_VideoDevice *_this, bool enabled)
|
|
|
+{
|
|
|
+ return WIN_SetRawKeyboardFlag(_this, NOHOTKEYS, enabled);
|
|
|
+}
|
|
|
+
|
|
|
#else
|
|
|
|
|
|
bool WIN_SetRawMouseEnabled(SDL_VideoDevice *_this, bool enabled)
|
|
|
@@ -262,6 +297,11 @@ bool WIN_SetRawKeyboardEnabled(SDL_VideoDevice *_this, bool enabled)
|
|
|
return SDL_Unsupported();
|
|
|
}
|
|
|
|
|
|
+bool WIN_SetRawKeyboardFlag_NoHotkeys(SDL_VideoDevice *_this, bool enabled)
|
|
|
+{
|
|
|
+ return SDL_Unsupported();
|
|
|
+}
|
|
|
+
|
|
|
#endif // !SDL_PLATFORM_XBOXONE && !SDL_PLATFORM_XBOXSERIES
|
|
|
|
|
|
#endif // SDL_VIDEO_DRIVER_WINDOWS
|