[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:
@@ -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.
|
||||
|
||||
@@ -44,6 +44,7 @@ class SDLInputDriver final : public InputDriver {
|
||||
X_RESULT SetState(uint32_t user_index, X_INPUT_VIBRATION* vibration) override;
|
||||
X_RESULT GetKeystroke(uint32_t user_index, uint32_t flags,
|
||||
X_INPUT_KEYSTROKE* out_keystroke) override;
|
||||
virtual InputType GetInputType() const override;
|
||||
|
||||
private:
|
||||
struct ControllerState {
|
||||
|
||||
Reference in New Issue
Block a user