-
Notifications
You must be signed in to change notification settings - Fork 843
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
(v2) Use KeyMsg/MouseMsg interfaces #1111
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aymanbagabas
force-pushed
the
v2-msg-interface
branch
from
August 23, 2024 20:31
b4a47eb
to
c8f6132
Compare
bashbunni
reviewed
Aug 24, 2024
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.
There are some magic numbers in there too that the linter picked up. The changes look good though, stoked to have kitty keyboard support 🚀
aymanbagabas
force-pushed
the
v2-msg-interface
branch
2 times, most recently
from
August 28, 2024 14:23
e1d239f
to
45f800f
Compare
aymanbagabas
force-pushed
the
v2-msg-interface
branch
2 times, most recently
from
August 28, 2024 15:44
361ec9a
to
5508557
Compare
Use key and mouse interfaces to catch their respective types as an interface.
aymanbagabas
force-pushed
the
v2-msg-interface
branch
from
August 30, 2024 13:37
c38edfe
to
2f6637b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This replaces KeyMsg and MouseMsg with interfaces that catch their respective types. For example, both KeyPressMsg and KeyReleaseMsg implement KeyMsg. Same goes for MouseClickMsg, MouseReleaseMsg, etc, they all implement MouseMsg. This makes it possible to switch on the interface type to catch all events of the same input message type.
New API:
TODO: update examples (in a separate PR)