Skip to content

Custom and extendable devices #2

@nezuo

Description

@nezuo

Instead of the built-in devices we have now we could let the user create their own devices or extend the default ones we provide.

Potential API:

local device = Device.new("Keyboard")
	:addControl("Space", Enum.KeyCode.Space, ButtonControl.new())

inputState:addDevice(device)

Considerations:

  1. More boilerplate, user has to specify what devices they want.
  2. Is it even helpful for the user to add their own devices or extend the existing ones?
  3. How should the user access device's controls now? device:get("control") or device.control?
  4. Is our definition of a control good enough for it to be a public API?
  5. We would also need to export classes like ButtonControl and Axis2dControl.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions