fishfolk / punchy

A 2.5D side-scroller beatemup, made in Bevy

Home Page:https://fishfolk.github.io/punchy/player/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In the controls menu, tapping Enter to choose a mapping, automatically choses Enter as mapped key

64kramsystem opened this issue · comments

Description

If one wants to remap a control, and taps Enter, the control is mapped to Enter, without allowing to choose any other key.

To Reproduce

  • Go to the controls menu
  • Move to a control mapping (e.g. "Up", for "Keyboard 2" -> "Move Up")
  • Tap enter

Enter is now assigned.

Expected Behavior

The mapping "Press an input or press Escape to cancel" dialog should be displayed.

Additional Context

The mapping dialog is actually displayed, for a fraction of second. It seems that then tapping enter, the enter keypress is sent to the dialog as well, which thinks that Enter is the chosen key.

Log Messages

No response

Oh, bummer. I had a lot of trouble with fixing that, and apparently the fix worked on my machine and not your machine. :/

I wasn't 100% sure that the solution I had in place to avoid that issue that was good enough, but now I know that it's not. If nobody fixes it first I'll get to this when I implement the bindings menu refactor.

It's happening with me too, but for some reason, with the Space key. When i move to a control mapping, and tap Space, Space is assigned, but it doesn't happens to any other key. About enter, when i do the same thing but tapping enter, enter is assigned too, but, it allows i choose a key anyway.

Obs: I realized that the button doesn't have an "down" animation when something is selected with Space or Enter, then the solution may be to make the Enter and Space act as a normal mouse click.

Thanks for the extra info @DRuppFv! I just tried it again on my machine and I'm noticing the same results now. Not sure why I didn't run into the same thing earlier, but it's definitely something I'll work on fixing.

WRT the button down animation for pressing buttons, it's little bit of a weird thing because pressing enter triggers whatever button is highlighted immediately, but when a mouse clicks on it, we only trigger when you release the mouse button.

Do you think it would make sense to only trigger the button when you release the enter key, and therefore play the animation while the button is down? PS: We should probably open a new issue. :)