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

fix(settings): networking tab input #1023

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nelson137
Copy link
Contributor

Fixes #933

Disabling only gamepad input seems to make the input behave as one would expect. Arrow keys, backspace, etc work like normal, and bound keys (e.g. A, D) only update the text and no longer move the caret.

Unfortunately I don't have a controller to test with, but I assume this will work with those kind of inputs too.

@MaxCWhitehead
Copy link
Collaborator

It's interesting to me that this fixes it, I wonder if disable_gamepad_input is not named very well?

This does seem to fix the issue with A/D, but I don't quite understand it. Anywho I'll test with gamepad at some point to make sure this doesn't impact anything outside network tab - am slightly concerned if leave the network menu gamepad will remain disabled but not sure.

Thanks!

@nelson137
Copy link
Contributor Author

Yeah I was surprised it just worked. Re-reading through the 1 usage of disable_gamepad_input now it makes more sense:

  • inputs are always parsed and the just_moved, move_direction, etc. are still set on the player controllers
  • and when not disable_gamepad_input, a player controller with a move direction of left (.x < -0.1) would cause an egui::Key::ArrowLeft input event to be pushed to egui's events, for example

So the player controller is still registering A/D as left/right, but those aren't causing Arrow{Left,Right} events (which are read by the text area and would make the caret move).

am slightly concerned if leave the network menu gamepad will remain disabled but not sure

From my experimentation with egui, anything done to the context is scoped to that part of the UI, so leaving the networking tab would be in a different scope that doesn't have the EguiInputSettings set...? (Every now and then I jump into egui code but rarely understand what's going on.) And A/D still work after going into character selection.

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

Successfully merging this pull request may close these issues.

WASD inputs in matchmaking server text box move text cursor
2 participants