Repository navigation
Fix control binding the escape key. - #2896
IntegratedQuantum merged 8 commits into
Conversation
IntegratedQuantum
left a comment
There was a problem hiding this comment.
The same issue applies to all other keybinds that can be pressed while in the settings.
So please apply this fix in a central location where it applies to all keybinds.
When pressing the escape key while in a control binding process, then the control should get bound to escape and the settings window should still be open. This commit disables closing the settings window while binding a key. fixes: PixelGuys#2257
dd31fc0 to
e721590
Compare
| } | ||
|
|
||
| fn action(self: *Key, typ: enum { press, release, repeat }, isGrabbed: bool, mods: Modifiers, textKeyPressedInTextField: bool) void { | ||
| if (hasNextInputListenter()) return; |
There was a problem hiding this comment.
Doing this here has a side effect: If I click on a button to bind a gamepad key, without having a controller installed, I'll get stuck unable to interact with anything. I'd suggest to move the check to functions that handle the listeners.
There was a problem hiding this comment.
Sorry, I totally missed this.
While fixing this I discovered another bug.
When clicking a button to bind a gamepad key, without having a controller installed, then it is not possible to bind it to a keyboard key again and you are cannot rebind the key.
I suggest resetting the binding process when toggling from keyboard to gamepad and vise versa.
I included this fix in this pr.
I have no Gamepad so please check if everything works as expected.
There was a problem hiding this comment.
You should probably also reset the binding process when closing / opening the window. Currently when set to gamepad mode and trying to set a key, but if you then close the window by for example pressing any keyboard key or clicking with the mouse outside the window. The binding process is not reset.
|
Tested the latest commit with a controller, and rebinding keys works. Some keys do close the settings menu though when binding them, these are X and B. And binding the thumbstick scrolls the setting menu. But the same bugs are present on the master version as well :) |
IntegratedQuantum
left a comment
There was a problem hiding this comment.
Alright then please also fix the issue mentioned in #2896 (comment)
Thanke you for testing it :) If someone want to look into it, here is the relevant code |
| } | ||
|
|
||
| pub fn onOpen() void { | ||
| pub fn initWindow() void { |
There was a problem hiding this comment.
should be private now that you renamed it
| } | ||
|
|
||
| pub fn onClose() void { | ||
| pub fn deinitWindow() void { |
When pressing the escape key while in a control binding process, then the control should get bound to escape and the settings window should still be open.
This commit disables closing the settings window while binding a key.
fixes: #2257