Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(component): Add a mean for components to access raw key events #81

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

louis-thevenet
Copy link

Description

This adds an is_editing method 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.

@orhun orhun changed the title Feat(component): Add a mean for components to access raw key events feat(component): Add a mean for components to access raw key events Sep 29, 2024
Copy link
Member

@orhun orhun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 from me, also do you mind sharing what are you building & why you needed this? 👀

@louis-thevenet
Copy link
Author

Sure! I'm building a markdown tasks parser and manager. I wanted to add a search bar and therefore needed to get user input.
Here is how it turned out =)

2024-09-29.22-49-02.mp4

@orhun
Copy link
Member

orhun commented Oct 1, 2024

that looks pretty! looking forward to the new releases, I want to package it for Arch 🐻

@joshka
Copy link
Member

joshka commented Oct 3, 2024

I defer to @kdheepak for whether this is the right idea. I'm not too familiar with this template.

@kdheepak
Copy link
Contributor

kdheepak commented Oct 3, 2024

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.

@louis-thevenet
Copy link
Author

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 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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants