Skip to content

Joystick/Controller/Gamepad design #943

@bvssvni

Description

@bvssvni

I'd like to have a cross platform library for user input (#884), but it would be nice if both separate libraries and window back-ends could integrate with the event model. There are platforms where controllers are the major way of interacting, and this must be supported by widget frameworks.

pistoncore-input could have some structures similar to the design in SDL2. SDL2's way of dealing with this is to send an event when a device is connected or disconnected. Each input device is assigned an id and has buttons and axis states (absolute).

Alternative is Steenberg's Betray PistonDevelopers/input#20 which seem well thought out. This unites multi-touch with controllers. Could be used in a cross platform API.

I think that button presses could be used with PressEvent. In many cases you want to handle the button events separately from the axis motion. This integrates nicely with the event model.

  • An event model based on SDL2, integrated with the current design
  • A cross platform API based on Betray, with functions for mapping to the event model

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions