Open Kees-van-Beilen opened 8 months ago
So you want some keyboard shortcut that will trigger some Button. I guess those should work with any element having focus and as long as your application has window focus?
In case there is a global shortcut conflicting with a shortcut on a focused TextArea, which one should get triggered? Would you expect the Button with that shortcut to get triggered or the action on the focused TextEdit to be taken?
This was also discussed in https://github.com/slint-ui/slint/discussions/4063 I think we should indeed have a filter-key-pressed or something on the FocusScope.
I think we should mimic something likes Apple's first responder system. Though, how hard would it be to implement waterfall events? It could be an option on the FocusScope. If a waterfall-unused-events
(at least for key events now) bool sounds good, I'll implement it.
Currently creating buttons that have keyboard shortcuts attached to them is a pain. I recommend something similar to
FocusScope
with a small change, where on objects with focus can accept or reject a keyboard event. In case of rejection the event gets cascaded to its children.Would this be possible?