Display mouse buttons in visualizer#346
Open
esphynox wants to merge 1 commit into
Open
Conversation
Member
|
Thanks for the PR, looks reasonably clean and focused. The question here was never about feasibility, but what should it look like? I'm not a fan of these tokens, I think they should be replaced with some iconography. And same is true of the mouse visualizer overlay. |
Author
|
Iconography first pass - wanted your read on direction before going further. Used custom PDF assets since Emoji / SF Symbols has no per-button variants for icons. Does the L/R/M direction work? Before we sort out edge cases like MB4+, worth confirming the basic icon style is what you had in mind. Demo: keycastr-iconography-test.mov |
This file contains hidden or 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
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.
What (#345)
When the "With Current Visualizer" mouse display option is enabled, the keystroke visualizer previously rendered every mouse click as a single "🖱️" glyph, so viewers couldn't tell which button was pressed.
This change makes
KCEventTransformeremit a button-specific token instead:LMBRMBMMBMB<N+1>(1-indexed)Modifier prefixes still glue to the token, same as keystrokes:
⌘LMB,⌥⇧RMB, etc.Scope
KCEventTransformer, so both the Default and Svelte visualizers pick up the new tokens automatically through, no per-visualizer code changes needed.KCMouseEventVisualizer) is unchanged.KCDefaultVisualizer.addMouseEvent:.Implementation
buttonNumbertoKCMouseEvent, captured fromNSEvent.buttonNumberininitWithNSEvent:.🖱️string inKCEventTransformer.mwith a switch onevent.typeplus abuttonNumberlookup for the "other" cases.Demo
keycastr-mouse-button-number-demo.mp4