diff --git a/documentation/proposals/Proposal - Input.md b/documentation/proposals/Proposal - Input.md new file mode 100644 index 0000000000..2299325034 --- /dev/null +++ b/documentation/proposals/Proposal - Input.md @@ -0,0 +1,391 @@ +# Summary +Proposal API for Input via keyboards, mice, and controllers. + +# Contributors +- Dylan Perks, Ultz Limited +- Aaron Pearson, Ultz Limited +- Vassalware, Silk.NET Contributors + +# Current Status +- [x] Proposed +- [ ] Discussed with API Review Board (ARB) +- [ ] Approved +- [ ] Implemented + +# Design Decisions +- Vibration has been excluded from this proposal, as we'd like to come up with a complete API for HD Rumble etc. +- I've decided to use interfaces for nearly everything, so that the implementation has more control. +- All modifications of states (i.e. functions) will go within the interface, whereas structs are used for read-only data. +- **IMPLEMENTATION DETAIL/REQUIREMENT:** In implementations, once an IJoystick, IGamepad, or other IInputDevice object has been created, **it must not be destroyed until its IInputContext is disposed**. This is to preserve event bindings. +- ButtonDown/Up and KeyDown/Up events (and similar) all fire once, when the key is first pushed down or up. I intend to champion a few extension packages to support more use cases, but I've kept this API pretty barebones. + +# Proposed API +## Interfaces + +### IJoystick +```cs +public interface IJoystick : IInputDevice +{ + IReadOnlyCollection Axes { get; } + IReadOnlyCollection