Skip to content

Input Modules #4

@FavouriteDragon

Description

@FavouriteDragon

Input will be consolidated into isolated input modules. An input module has a couple of tasks:

  1. Register any listeners it needs for input
  2. Listen and keep track of input
  3. Emit events to the radix tree as they occur

For example, within the context of the keyboard & mouse input module, this would look like this:

  1. Subscribing to the correct Forge events
  2. Keeping track of mouse movement and traversing a radix tree based on the keypresses
  3. Send a start input event once the bending toggle key is pressed, send Forms as they are formed from keyboard presses or mouse movement, then send the stop input event once the bending toggle key is pressed once more.

So, what is needed is at least an implementation of the keyboard & mouse input module. A base input module interface might be helpful, but it shouldn't be too restrictive as it is up to each individual input module to decide how they want to structure themselves, as data is passed directly from each input module to the radix tree.

Important is that input modules should be dynamic. It should be possible to unregister and register them at any point, even mid-game.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

🏗 In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions