Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rebind joysticks #15655

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Add rebind joysticks #15655

wants to merge 4 commits into from

Conversation

wrrrzr
Copy link
Contributor

@wrrrzr wrrrzr commented Jan 8, 2025

Add compact, short information about your PR for easier understanding:

PR Added support for rebind joystick

To do

This PR is a Work in Progress.

  • Add class GUIJoystickChangeMenu
  • Buttons Save/Cancel
  • Draw joystick scheme
  • Allow rebind joystick
  • Translation

How to test

PR is work in progress

@wrrrzr wrrrzr changed the title Add guiJoystickChangeMenu Add rebind joysticks Jan 8, 2025
@Zughy Zughy marked this pull request as draft January 8, 2025 10:27
@Zughy Zughy added Feature ✨ PRs that add or enhance a feature @ Client / Controls / Input Roadmap: Needs approval The change is not part of the current roadmap and needs to be approved by coredevs beforehand labels Jan 8, 2025
@rollerozxa
Copy link
Member

Probably worth noting that the current joystick & controller support provided by Irrlicht is for the most part useless due to its unreliability. It is being planned on being replaced by SDL's gamepad support so spending time on the support provided by Irrlicht may not be worthwhile.

@y5nw
Copy link
Contributor

y5nw commented Jan 8, 2025

I'm not sure whether I exactly agree with the approach of this PR.

Looking at this (and also #14964), it makes more sense IMO to wait until we rely on SDL (i.e. drop non-SDL devices) and then modify KeyPress to something along the lines of

class KeyPress {
public:
  enum InputType { KEYBOARD, MOUSE, JOYSTICK };
  bool operator== (const KeyPress &o) const {
    return type == o.type && button == o.button;
  }
  ...
private:
  InputType type;
  u32 button; // keyboard: scancode; mouse/joystick: button on the device.
};

after which we can then use KeyPress for input handling and use the key change menu to bind joystick controls. (Edit: Alternatively, I wonder whether we can simplify things by registering keyboard/mouse/touchscreen controls as virtual joysticks in SDL.)

Also aren't we moving to Lua formspecs with #15614? Using a C++/Irrlicht GUI form in the style of the current GUIKeyChangeMenu is IMO against that goal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Client / Controls / Input Feature ✨ PRs that add or enhance a feature Possible close Roadmap: Needs approval The change is not part of the current roadmap and needs to be approved by coredevs beforehand
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants