pokerogue
pokerogue copied to clipboard
Menu - Controls Rebind - Gamepad & Keyboard
Original PR: #685
What are the changes?
This PR aims to enable players to rebind their gamepad buttons and keyboard keys.
What are the "features"?
- Display the relevant action buttons in the menu according to the controls being used (buttons for gamepads and keys for keyboards).
- A new tab: Gamepad, where we can rebind the gamepad buttons.
- A new tab: Keyboard, where we can rebind the keyboard keys.
- For keyboards, we can have two sets of bindings per action: the main and the alternate one.
- In the Gamepad tab, we can select which connected controller to use and assign bindings to that specific controller.
- When we choose to change a binding for an action, a small window opens and prompts the user to press a button or key. This window auto-closes after 5 seconds if no input is detected.
- For a gamepad, when we choose a binding that is already assigned, it will ask for confirmation to swap the two buttons.
- For the keyboard, when we choose a binding that is already assigned, it will remove this binding from the previous action and assign it to the new one.
- There are some protected bindings that we can't change since they are important:
- For gamepads: D-pad buttons
- For keyboards: Arrows, Esc, Enter, Del, Home, Space
- These are displayed in gray (vs. yellow) and don't have a text saying: "Press action to assign".
- The bindings are persistent on refresh.
- On keyboard only, you can delete a selected binding with the Delete button.
- You can reset all the bindings you've done with the Home button.
- Prevent the deletion of the last binding for an action. -Display the extended touch button (like on the starter selection screen) on the menu since you need two more buttons to navigate there.
Screenshots
Gamepad:
Keyboard:
How to test the changes?
You can test them on my test instance: https://pokerogue.greenlamp.ovh/