-
Notifications
You must be signed in to change notification settings - Fork 117
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
QOL: Add keypad shortcuts so users can type with keyboard #85
Conversation
Thanks for this. Examples:
|
Just to clarify, 'E' is in reference to the 'E' button on the Keypad UI. There is no usage of the 'E' keyboard button in this change. I'm using keyboard 'Enter' to press the keypad UI's 'E' button, which it doesn't look like there's any inputs currently using. But very good point on those default number shortcuts. |
I've just added a change that keeps track of focus and consumes the input if the keypad is visible and in focus. |
Oops, yeah you're right. I kinda confused myself. I did notice tho that when navigating the number buttons with the keyboard arrow keys and then "pressing" those buttons with the enter key, it adds the number to the keypad (as expected) but also triggers the keypad UI 'E' button (as inteded by your change). I think this is a pretty minor thing and potentially easily fixable, but wanted to mention it. Everything else works great otherwise! |
@Phazorknight Give it a shot now. Provided I've done things right: It's also now using Godot's default 'ui_accept' action input mapping. CogitoButton nodes now have an optional switch to 'accept contextual enter' which will provide this functionality to any UI panel that might want it, and the "context" can be set by using Control's shortcut_context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Amazing work!
Added shortcuts to the keypad buttons so now when users type numbers on their keyboard or numpad, it will press the corresponding UI button.
Enter serves as 'E' on the keypad
Backspace or Joypad action right button serves as 'C' on the keypad