[HID] Fixed some issues with controller/passthrough visibility.

- Moved X_INPUT flags from kernel to HID
- Added ability to return input type from driver
This commit is contained in:
Gliniak
2024-12-23 10:43:27 +01:00
parent 11f14e8488
commit 2e521383c2
15 changed files with 110 additions and 52 deletions

View File

@@ -288,9 +288,7 @@ X_RESULT SDLInputDriver::GetKeystroke(uint32_t users, uint32_t flags,
if (!out_keystroke) {
return X_ERROR_BAD_ARGUMENTS;
}
if ((flags & XINPUT_FLAG_KEYBOARD) != 0) {
return X_ERROR_INVALID_PARAMETER;
}
// The order of this list is also the order in which events are send if
// multiple buttons change at once.
static_assert(sizeof(X_INPUT_GAMEPAD::buttons) == 2);
@@ -431,6 +429,8 @@ X_RESULT SDLInputDriver::GetKeystroke(uint32_t users, uint32_t flags,
return X_ERROR_EMPTY;
}
InputType SDLInputDriver::GetInputType() const { return InputType::Controller; }
void SDLInputDriver::HandleEvent(const SDL_Event& event) {
// This callback will likely run on the thread that posts the event, which
// may be a dedicated thread SDL has created for the joystick subsystem.