feat(component): Add a mean for components to access raw key events#81
feat(component): Add a mean for components to access raw key events#81louis-thevenet wants to merge 4 commits intoratatui:mainfrom
Conversation
orhun
left a comment
There was a problem hiding this comment.
+1 from me, also do you mind sharing what are you building & why you needed this? 👀
|
Sure! I'm building a markdown tasks parser and manager. I wanted to add a search bar and therefore needed to get user input. 2024-09-29.22-49-02.mp4 |
|
that looks pretty! looking forward to the new releases, I want to package it for Arch 🐻 |
|
I defer to @kdheepak for whether this is the right idea. I'm not too familiar with this template. |
|
I think this is a good reference PR! Thanks for making it. I'm not sure if we should merge it though, because the component template is already more complex than I'd like for a template and severely under-documented. |
|
Your review was correct, I think this new version is cleaner. It allows a component to set specific actions to be escaped in editing mode.
I agree with you, I'm happy with the template and did not have to change it a lot beside this "can't access raw keys" issue. But it was not a "ready to jump in" template for me, especially for a first Ratatui app, it took me some time to get comfortable with it. |
Description
This adds an
is_editingmethod to components for whether they should receive all key inputs or just the regular actions.Why
Currently, there is no way for a component to take user input.