#input #generic #helper #unifying #framework #type #unified

input_helper

Generic types and tools for unifying input libraries

2 releases

0.1.2 May 10, 2022
0.1.0 May 8, 2022

#1 in #unifying

MIT/Apache

11KB
117 lines

Input Helper

Generic types and tools for unifying input libraries.

The main job of Input Helper is to provide a single, unified way to process input from any input framework.

Project Status

NOTE: Input Helper is still in the planning / testing stages. It is not ready for use at the moment.

The Problem

Most libraries that take user input do so in a library-specific way. In order to use the library, you must write library-specific code.

For example: You can't switch from Winit to SDL, or Gilrs to SDL, or any other library without having to rewrite all your input code. This can either couple your project to specific framework(s), or force you to waste time duplicating code. In the case of using multiple input libraries, such as pairing Winit and Gilrs you must handle each framework separately.

The Solution

Library-specific input events can be converted to InputEvents, and sent through Input Helper using InputHelper::send(). Then your application code can be written against Input Helper. If you ever need to switch your input system, then there's no need to rewrite your business logic. This also allows you to process all input code in a single place regardless of its source.

Input Helper will provide default integration functions for common frameworks such as Winit, SDL, and Gilrs.

Contribution

License

Input Helper is licensed under either

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without additional terms or conditions.

Dependencies

~0.6–7MB
~146K SLoC