Skip to content

Refactor & simplify InputHandler.ts #2759

@evanpelle

Description

@evanpelle

Refactor it into a "binding" system to simplify mapping of key => action.

example:

{
  inputs: [ Keyboard.ButtonDown('A') ],
  event: {
    type: FooBarGameEvent,
    factory: (manager, input, binding) => new FooBarGameEvent(input.value),
  },
  labelKey: 'user_setting.foobar',
  descriptionKey: 'user_setting.foobar_desc',
  isEnabled: false,
  isConfigurable: true,
}

Discord thread: https://discord.com/channels/1359946986937258015/1456342312668893308

Metadata

Metadata

Labels

RefactorCode cleanup, technical debt, refactoring, and architecture improvements.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions