User-Device-Input Refactor (ReInput) #22

Open
opened 2024-12-07 15:40:05 -05:00 by josh · 2 comments
Owner

Refactor interface and implementation for user-device-input into separate interfaces which can be derived and implemented per-platform. Additionally, a global, static InputService namespace will be provided.

Features:
Support target platforms with the same user API. (Windows, Linux, more later)
Input Polling
Input Events (Can queue, set priority, consume, etc.)
Key / Input Repeat Support
Text Input
Localization
Input Device Introspection (List #, Vendor, Layout, Supported Features)
Maybe Support Multiple Gamepads at once.
Touch and Gesture Support
VR Input Support (Not full VR support!)
Raw Mouse Input
Integrate with JUI Keybind Menu

InputService:
Mouse::GetPosition()
Mouse::IsButtonDown()
Mouse::OnButtonDownEvent()

Scan Codes / Enums:

ReScanCode (I kinda dislike the idea of bundling all scancodes together but I can live with it if you really want it.)
Key
MouseButton
GamepadButton

Input events:
InputEvent
MouseEvent
MouseButtonDownEvent
MouseButtonUpEvent
MouseWheelEvent
MouseMoveEvent
KeyboardEvent
KeyDownEvent
KeyUpEvent
TouchEvent
TouchPressEvent
TouchReleaseEvent

InputState structutes:
MouseButtonState
MouseState
KeyState
KeyboardState
GamepadButtonState
GamepadState

InputDevice Interfaces:

class InputDevice;
class PointerDevice;
class Mouse;
class Touchscreen;
class GamePad;
class XboxGamepad;
class PS4Gamepad;
class VRSystem;
class VRDevice;
class VRHeadset;
class VRController; // Generally will have two for L and R

class ResponsiveDevice;
class Thumbstick;
class Trigger;
class RumbleMotor;

Refactor interface and implementation for user-device-input into separate interfaces which can be derived and implemented per-platform. Additionally, a global, static InputService namespace will be provided. Features: Support target platforms with the same user API. (Windows, Linux, more later) Input Polling Input Events (Can queue, set priority, consume, etc.) Key / Input Repeat Support Text Input Localization Input Device Introspection (List #, Vendor, Layout, Supported Features) Maybe Support Multiple Gamepads at once. Touch and Gesture Support VR Input Support (Not full VR support!) Raw Mouse Input Integrate with JUI Keybind Menu InputService: Mouse::GetPosition() Mouse::IsButtonDown() Mouse::OnButtonDownEvent() Scan Codes / Enums: ReScanCode (I kinda dislike the idea of bundling all scancodes together but I can live with it if you really want it.) Key MouseButton GamepadButton Input events: InputEvent MouseEvent MouseButtonDownEvent MouseButtonUpEvent MouseWheelEvent MouseMoveEvent KeyboardEvent KeyDownEvent KeyUpEvent TouchEvent TouchPressEvent TouchReleaseEvent InputState structutes: MouseButtonState MouseState KeyState KeyboardState GamepadButtonState GamepadState InputDevice Interfaces: class InputDevice; class PointerDevice; class Mouse; class Touchscreen; class GamePad; class XboxGamepad; class PS4Gamepad; class VRSystem; class VRDevice; class VRHeadset; class VRController; // Generally will have two for L and R class ResponsiveDevice; class Thumbstick; class Trigger; class RumbleMotor;
josh self-assigned this 2024-12-07 15:40:28 -05:00
maxine was assigned by josh 2024-12-07 15:40:28 -05:00
Collaborator

I would like the Input Service to be a class/general interface RWindow interacts with. Still wondering how I can make a general InputServiceEvent transport and do deductions. Actually it may be of interest to have devices take hooks provided by the programmer. Not sure yet.

I would like the Input Service to be a class/general interface RWindow interacts with. Still wondering how I can make a general InputServiceEvent transport and do deductions. Actually it may be of interest to have devices take hooks provided by the programmer. Not sure yet.
Author
Owner

It appears to be possible, on linux, to read keyboard, mouse, and gamepad inputs from the kernel directly. If so, I propose we migrate the existing functionality to a separate ReInput project, and drop XOrg from it on Linux. I am currently working on controller support, and I am doing it this way, so I think it would be worthwhile.

It appears to be possible, on linux, to read keyboard, mouse, and gamepad inputs from the kernel directly. If so, I propose we migrate the existing functionality to a separate ReInput project, and drop XOrg from it on Linux. I am currently working on controller support, and I am doing it this way, so I think it would be worthwhile.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Redacted/ReWindow#22
No description provided.