textual
textual copied to clipboard
[textual][key binding] Add the possibility to pass the key event to the Action, by using a special value in the expression? i.e. `self.bind("1,2,3", "scroll_to_placeholder(${event.key})")`
--> so the action_scroll_to_placeholder
method would be able to know which of these keys were pressed :slightly_smiling_face:
We could perhaps make the action a format string that gets called with key. So the following would work:
self.bind("1,2,3", "scroll_to_placeholder(${event.key})")
After discussion, the implementation of this feature is postponed - so we can find the right balance between flexibility of the syntax and code complexity
https://github.com/Textualize/textual/wiki/Sorry-we-closed-your-issue
Did we solve your problem?
Glad we could help!