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

Suggestions for more input/controller stuff #604

Open
BenevolusGoat opened this issue Dec 14, 2024 · 0 comments
Open

Suggestions for more input/controller stuff #604

BenevolusGoat opened this issue Dec 14, 2024 · 0 comments

Comments

@BenevolusGoat
Copy link
Collaborator

I'm in the process of creating a new menu on the main menu and ran into a small couple issues in relation to input, as I want to be able to differentiate keyboard and controller inputs for different actions and different graphics. Here's some suggestions I thought of that could be handy

  • Input.GetDeviceNameByIdx() currently doesn't appear to return anything useful. Keyboard will always be "Keyboard" but I connected both an Xbox and Switch Pro controller and the only result I got was "XInput Controller 1", 2, 3, etc. In gfx/ui, there's buttons.anm2, which has different animations depending on the type of identified controller. I'd like to be able to get the proper name of the controller if possible to point to the right set of buttons...though its possible that this is just how the game sees the controllers and these are meant for the other consoles? Regardless, the main menu seemed to use the XboxOne buttons despite PS4 being the literal "default" animation, so there surely must be some kind of default identification
  • The main menu clearly tracks whichever device had an input of any kind last and updates its graphics accordingly. Maybe an "Input.GetLastActiveDeviceIdx()"? I currently have to loop through index 0 - 4 just to guess the number of indexes present and check every single ButtonAction to update a local variable that stores the last used idx
  • Controller enum/enum per controller type for IsButtonTriggered/Pressed. I'm assuming this would line up with the controls_buttons.anm2, as gfx/backdrops/controls_buttons.anm2 has a Keyboard animation and it certainly matches up with the Keyboard enum

tl;dr:

  • Input.GetDeviceNameByIdx() except the actual names like XboxOne, PS4, Switch_Pro, etc. On PC its currently returning XInput Controller 1, 2, 3, etc
  • Input.GetLastActiveDeviceIdx() for the menu
  • Generic Controller or per-controller-type enum for Input.IsButtonTriggered/Pressed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant