Skip to content

Commit f698417

Browse files
authored
Revert changes to original input proposal
1 parent 13bc5bd commit f698417

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

documentation/proposals/Proposal - Multi-Backend Input.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ Proposal API for backend-agnostic, refactored Input via keyboards, mice, and con
33

44
# Contributors
55
- Dylan Perks (@Perksey)
6-
- Lumi (@Lumi2021)
76

87
# Current Status
98
- [x] Proposed
10-
- [ ] Discussed with Working Group
11-
- [ ] Approved
9+
- [x] Discussed with Working Group
10+
- [x] Approved
1211
- [ ] Implemented
1312

1413
# Design Decisions
@@ -258,23 +257,23 @@ This will be configurable on `Mice` (i.e. via `InputContext.Mice.ClickConfigurat
258257
Unlike 1.0 and 2.0, this proposal uses `readonly record struct`s as their only argument for the event action. This allows us to provide more information to the event handlers without breaking in the future. These types are farily simple:
259258

260259
```cs
261-
public readonly record struct ConnectionEvent(IInputDevice Device, DateTimeOffset? Timestamp, bool IsConnected);
262-
public readonly record struct KeyDownEvent(IKeyboard Keyboard, DateTimeOffset? Timestamp, Key Key, bool IsRepeat);
263-
public readonly record struct KeyUpEvent(IKeyboard Keyboard, DateTimeOffset? Timestamp, Key Key);
264-
public readonly record struct KeyCharEvent(IKeyboard Keyboard, DateTimeOffset? Timestamp, char Character);
265-
public readonly record struct MouseDownEvent(IMouse Mouse, DateTimeOffset? Timestamp, Vector2 Position, MouseButton Button);
266-
public readonly record struct MouseUpEvent(IMouse Mouse, DateTimeOffset? Timestamp, Vector2 Position, MouseButton Button);
267-
public readonly record struct MouseMoveEvent(IMouse Mouse, DateTimeOffset? Timestamp, Vector2 Position, Vector2 Delta);
268-
public readonly record struct MouseScrollEvent(IMouse Mouse, DateTimeOffset? Timestamp, Vector2 Position, Vector2 WheelPosition, Vector2 Delta);
269-
public readonly record struct MouseClickEvent(IMouse Mouse, DateTimeOffset? Timestamp, Vector2 Position, MouseButton Button);
270-
public readonly record struct JoystickDownEvent(IJoystick Joystick, DateTimeOffset? Timestamp, JoystickButton Button);
271-
public readonly record struct JoystickUpEvent(IJoystick Joystick, DateTimeOffset? Timestamp, JoystickButton Button);
272-
public readonly record struct JoystickHatMoveEvent(IJoystick Joystick, DateTimeOffset? Timestamp, Vector2 Value, Vector2 Delta);
273-
public readonly record struct JoystickAxisMoveEvent(IJoystick Joystick, DateTimeOffset? Timestamp, int Axis, float Value, float Delta);
274-
public readonly record struct GamepadDownEvent(IGamepad Gamepad, DateTimeOffset? Timestamp, JoystickButton Button);
275-
public readonly record struct GamepadUpEvent(IGamepad Gamepad, DateTimeOffset? Timestamp, JoystickButton Button);
276-
public readonly record struct GamepadThumbstickMoveEvent(IJoystick Joystick, DateTimeOffset? Timestamp, Vector2 Value, Vector2 Delta);
277-
public readonly record struct GamepadTriggerMoveEvent(IJoystick Joystick, DateTimeOffset? Timestamp, int Axis, float Value, float Delta);
260+
public readonly record struct ConnectionEvent(IInputDevice Device, bool IsConnected);
261+
public readonly record struct KeyDownEvent(IKeyboard Keyboard, Key Key, bool IsRepeat);
262+
public readonly record struct KeyUpEvent(IKeyboard Keyboard, Key Key);
263+
public readonly record struct KeyCharEvent(IKeyboard Keyboard, char Character);
264+
public readonly record struct MouseDownEvent(IMouse Mouse, Vector2 Position, MouseButton Button);
265+
public readonly record struct MouseUpEvent(IMouse Mouse, Vector2 Position, MouseButton Button);
266+
public readonly record struct MouseMoveEvent(IMouse Mouse, Vector2 Position, Vector2 Delta);
267+
public readonly record struct MouseScrollEvent(IMouse Mouse, Vector2 Position, Vector2 WheelPosition, Vector2 Delta);
268+
public readonly record struct MouseClickEvent(IMouse Mouse, Vector2 Position, MouseButton Button);
269+
public readonly record struct JoystickDownEvent(IJoystick Joystick, JoystickButton Button);
270+
public readonly record struct JoystickUpEvent(IJoystick Joystick, JoystickButton Button);
271+
public readonly record struct JoystickHatMoveEvent(IJoystick, Vector2 Value, Vector2 Delta);
272+
public readonly record struct JoystickAxisMoveEvent(IJoystick Joystick, int Axis, float Value, float Delta);
273+
public readonly record struct GamepadDownEvent(IGamepad Gamepad, JoystickButton Button);
274+
public readonly record struct GamepadUpEvent(IGamepad Gamepad, JoystickButton Button);
275+
public readonly record struct GamepadThumbstickMoveEvent(IJoystick, Vector2 Value, Vector2 Delta);
276+
public readonly record struct GamepadTriggerMoveEvent(IJoystick Joystick, int Axis, float Value, float Delta);
278277
```
279278

280279
This is the part of this proposal that incorporates the ideas in Enhanced Input Events, and is why this proposal supersedes that one.
@@ -715,7 +714,7 @@ public readonly record struct GamepadState
715714

716715
`Thumbsticks` contain the two thumbsticks on this gamepad. The X and Y values within this list range from -1 to 1: -1 being leftmost, and 1 being rightmost.
717716

718-
`Triggers` contains the two triggers on this gamepad. The values within this list range from 0 to 1: 0 being unpressed, and 1 being fully pressed.
717+
`Triggers` contains the two triggers on thsi gamepad. The values within this list range from 0 to 1: 0 being unpressed, and 1 being fully pressed.
719718

720719
Note the use of the `DualReadOnlyList` type. This is basically just:
721720
```cs

0 commit comments

Comments
 (0)