Controlify

Controlify

609k Downloads

Joystick support

isXander opened this issue ยท 1 comments

commented

What are joysticks?

Joysticks are very different to gamepads in GLFW: Joysticks have inputs of unnamed axes, buttons and hats with an unknown size whilst gamepads provide a set up defined buttons, like ABXY, left and right trigger, a dpad and thumbsticks.

Approach 1

This makes joysticks a lot harder to handle in games due to how abstract they are. This can be solved with mappings, https://github.com/gabomdq/SDL_GameControllerDB, which GLFW handles already. For UX purposes, an editor for mappings should be built-in and the mod should query some kind of API to find mappings already out there. These joysticks will then need to have a sort of initial setup process, to sort out the mappings, much like the gamepad thumbstick deadzone calibration.

Approach 2

Due to the abstract nature of Controlify's bind system, this mapping process may not need to exist, as the bind process could just create an abstract bind anyway with resource packs adding themes to joystick buttons which by default, may be something like A1 (axis 1), B1 (button 1) and H1 (hat 3). This is probably the way I will go with Controlify's implementation as it allows for more customizability with mappings and doesn't limit a user with pedals, steering wheels etc just to the input of one single gamepad.

To-do

  • Basic joystick input
  • Controller abstraction
  • Joystick binds
  • Resource-pack based mapping
  • Joystick button icon rendering
  • Joystick onboarding screen to setup mapping and binds
  • SDL_GameControllerDB in-game search tool to find mappings
commented

I am going to skip out on the joystick onboarding and mapping finder tool for the following reasons:

  • SDL mapping file I was going to use turned out to be quite unhelpful
  • Can be added to some capacity at a later release.