Customn keyboard navigation #3778
Replies: 2 comments 1 reply
-
|
At a high level - sure - I agree that there is scope to handle keyboard events in more situations. Podium (BeeWare's slide presentation app) is one example - it has custom keyboard handling specifically because of the limitations in Toga's default keyboard event handling. The specific example of using ENTER as an alternative to Beyond that, I guess the question is what that any other keyboard handling would actually look like - what use cases we're trying to handle, and where the right place to hook into that would be. Adding There's also "top level" keyboard handling - if I have a window that only has a box (or other static widgets), there's no focus, but obviously there's still a need to catch keyboard events. |
Beta Was this translation helpful? Give feedback.
-
|
Hi! Thanks for the reply. I took a quick look at Podium. I saw two keyboard handling methods at play:
I presume the second one is the custom handling you're referring to. But it doesn't seem to be called from anywhere. It seems to be just dead code now. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a small app and I would like to assign extra meaning to the ENTER and ESC keys.
The TextInput widget has
on_confirmthat handles the ENTER key, I'll use that.The Table widget has
on_activatethat handles double-click. I think it should also handle the ENTER key.But that's only half the problem. Generic sounding events that would handling the ESC key don't come to mind. For that, I would need some
on_keypressevent (available in all widgets that can accept focus) that would allow me to listen to all keystrokes.What are your views on that?
Beta Was this translation helpful? Give feedback.
All reactions