Keyboard activation on a hovered button? #4094
pnill
announced in
Old/Archived discussions
Replies: 1 comment
-
This is how immediate mode UIs work - we keep doing things over and over again. 99% of time cost is negligible. If you are concerned with performance - profile first, optimize later. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to make it so a keyboard key activates a button that's hovered over by a mouse? I was thinking I could just Use the IsItemHovered() code then check for a key press there, but was wondering if there's an alternative way I should be doing this that's already supported and doesn't require navigation with the keyboard ahead of time.
EDIT:
So using
IsItemHovered()
andIsKeyPressed()
just after creating the button does seem to work, but not sure if it's efficient to constantly pole for that, though I believe this happens in the background anyways to change the style of the button, just seems redundant to be doing it again... I guess one option would be to re-create the ImageButton routine and implement it with the input I'm looking for since I don't care about the mouse click on it just if the mouse is within it's rect and a specific key is pressed.Beta Was this translation helpful? Give feedback.
All reactions