hypermine icon indicating copy to clipboard operation
hypermine copied to clipboard

Add an input-management layer

Open patowen opened this issue 1 year ago • 1 comments

Currently, keyboard and mouse input is all handled in an ad-hoc manner in window.rs. Adding an extra layer of abstraction could help simplify the process of adding a new control. We could solve the following problems in one central place (although we don't need to solve them all now to resolve this issue):

  • Allowing rebinding of controls
  • Adding contextual controls
  • Having input presses that trigger an event on the next tick
  • Having an axis control for movement
  • Detecting conflicts (and allowing the same key to do multiple things if unambiguous enough)
  • etc. (This list is not exhaustive.)

Ideally, after this issue is done, if somebody wants to add a new key that does something, they'll just need to add the logic with minimal boilerplate code.

patowen avatar Jun 21 '24 05:06 patowen

This is very much needed. I've toyed with the idea of building something reusable inspired by OpenXR/Steam Input, but it's a hard design problem.

Ralith avatar Aug 07 '24 01:08 Ralith