iced
iced copied to clipboard
feat: add an on_key_press method to TextInput
Currently, the only way to listen for key presses involves setting up a subscription, which introduces some tedious boilerplate code: subscribe to the event, store the text input's ID, verify if it's focused, and so on.
Adding a method to TextInput just simplifies it.
An example use case for this would be terminal-like text inputs, where you're scrolling through the input history with the up & down arrows.