-
Notifications
You must be signed in to change notification settings - Fork 7
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update crossterm to 0.26.1 (fixed examples and add proper key release) #23
Conversation
Some more info here crossterm-rs/crossterm#772 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you 馃檱
Just added a smooth scrolling example that showcases it compared to normal scroll, however there's 1 issue with my idea: If you press another key without releasing the original one, then let go of it later, you can get a delayed release event which stops the scrolling for a little. For some reason even if I check if the original key is still being pressed, the code still gets triggered. But this is good enough for now. It would be really amazing to get it to work perfect natively in terminal imo, the only other crates I've seen that do this get input from outside the terminal which is less cool. |
We can figure that out later if you're willing to get it to work perfectly 馃槈 Do you think your branch is ready to merge, or is there something else you'd like to add ? |
I think key release events are windows only so I'll add a comment to the example right now, you can version bump yourself after this. That's it. |
I didn't implement window focus or paste because I'm not sure how, it just returns () now so it doesn't panic.
There's also a new
KeyEventState
which I didn't use because I think it requires kitty keyboard protocol in order to work. Which windows terminal/conhost doesn't support so maybe leave it for now.Lastly I noticed that in
--example shapes
holding down S or F which checks for key press not hold does the action a second time after a few frames. But this happens in crossterm 0.24 as well so it's unrelated to this.Closes #16 you could make a new issues for window focus, paste and the double key press? Fixes #22
This change now allows for smooth movement using console engine like I was trying to get in my issue 馃憤 .