User-Device-Input Refactor (ReInput) #22
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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;
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.
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.