Skip to content

Adds minimal visualizer#341

Open
SoCuul wants to merge 4 commits intokeycastr:minimal-visualizerfrom
SoCuul:minimal-visualizer
Open

Adds minimal visualizer#341
SoCuul wants to merge 4 commits intokeycastr:minimal-visualizerfrom
SoCuul:minimal-visualizer

Conversation

@SoCuul
Copy link
Copy Markdown

@SoCuul SoCuul commented Mar 28, 2026

This PR finishes the elements missing from the "Mods only (later renamed to minimal)" visualizer.

Including:

  • Mouse event support
  • Support for all characters (that are currently supported by the other visualizers)
  • Preferences to customize the text/background colors, font/bezel size, and bezel border radius
  • Anchoring options (to determine which direction it will expand away from)
  • Display mode options to toggle each element of the visualizer
image

@colinta
Copy link
Copy Markdown

colinta commented Mar 28, 2026

I'll test this out

@akitchen
Copy link
Copy Markdown
Member

Thanks for taking care of these things. I have some local changes in progress on this branch as well. I'll look at this all together and see about merging them, and hopefully we can launch this visualizer soon.

@SoCuul SoCuul force-pushed the minimal-visualizer branch from 3d8571b to 4a3e149 Compare March 29, 2026 15:59
@colinta
Copy link
Copy Markdown

colinta commented Mar 29, 2026

I noticed that the font selection doesn't play well with the drawing bezel - I would expect the bezel size to grow with the font size (ie the bezel setting would determine the margin). The current setup is fine, I think users can accomplish the goal of "make the size large and the bezel the same size, but it's two steps instead of one. Like, who would want this:

Screenshot 2026-03-29 at 2 26 00 PM

I would expect the "show non-modifier characters" to be off by default, but that's just me.

Screenshot 2026-03-29 at 2 28 36 PM

Overall I think this could ship as-is! No crashes or "real issues" found, just some cosmetic opinions that are completely subjective. Thanks, @SoCuul for taking this on, to be honest I had decided to give up on it (because it was suiting my needs 🤷‍♂️).

@SoCuul
Copy link
Copy Markdown
Author

SoCuul commented Mar 29, 2026

Didn't notice until now that the non-modifiers was set to true by default! Thanks for catching that.

For the font size being relative to the bezel size, I totally agree with you. It would just take a fair more amount of effort to get a result that looks good every time (especially since I have little experience with AppKit drawing code).

@akitchen akitchen self-requested a review April 1, 2026 02:29
@akitchen
Copy link
Copy Markdown
Member

akitchen commented Apr 1, 2026

Hey @SoCuul , thanks for your effort to help finish the work needed to get this visualizer into the app. A few things:

  • For Display Mode, the options should be Command Keys Only, All Modified Keys, and All Keys - similar to the Default visualizer. I'm open to a potential refactoring toward a shared view component for this which can be shared across different visualizers' settings panes, or we can keep this as a one-off and refactor it later to reduce duplication.
  • For Anchoring, IMO this should be automatic depending on where the visualizer is on screen. Not a strongly held opinion though.
  • Since these are significant changes, we would require updates to the license information in the files which add new behaviors (MinimalVisualizer{.h,.m}) including a real legal name.

Meanwhile I'll also test these changes and evaluate integration with other changes I have staged locally. Thank you.

@SoCuul
Copy link
Copy Markdown
Author

SoCuul commented Apr 1, 2026

Hey @SoCuul , thanks for your effort to help finish the work needed to get this visualizer into the app. A few things:

* For Display Mode, the options should be Command Keys Only, All Modified Keys, and All Keys - similar to the Default visualizer. I'm open to a potential refactoring toward a shared view component for this which can be shared across different visualizers' settings panes, or we can keep this as a one-off and refactor it later to reduce duplication.

* For Anchoring, IMO this should be automatic depending on where the visualizer is on screen. Not a strongly held opinion though.

* Since these are significant changes, we would require updates to the license information in the files which add new behaviors (MinimalVisualizer{.h,.m}) including a real legal name.

Meanwhile I'll also test these changes and evaluate integration with other changes I have staged locally. Thank you.

Hi @akitchen! In #342 I've added similar settings to the svelte visualizer, so I believe it would be best to refactor the settings into a view that can be used across the visualizer settings. It would be great if you could review the other changes present in that PR, as then I can build on top of them for the minimal visualizer branch.

@SoCuul
Copy link
Copy Markdown
Author

SoCuul commented Apr 2, 2026

I've finished a mostly complete implementation of a global display mode state in 7da5b63. It currently works perfectly with both the Default and Svelte visualizers.

At the moment, additional changes need to be made to KCEventTransformer to use values inside KCDisplayMode for validation, rather than the no longer accurate “isCommand” and “isModified” methods on KCKeystroke. I attempted to do this myself but wasn't able to get very far since I'm not familiar with the lengthy KCEventTransformer code.

Also, for the updates to the license information, would that require @colinta to add their name to the file as well?

Copy link
Copy Markdown
Member

@akitchen akitchen left a comment

Choose a reason for hiding this comment

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

Thanks for the effort to help get this visualizer ready for release. Just a few comments for now, mainly that the individual visualizers don't need to take on knowledge of mouse settings, they'll either receive mouse events or not.

There's a few other unrelated things to work out before we can release but I'm open to taking these changes on the minimal-visualizer branch once the mouse handling stuff is cleaned up.

- (void)setCurrentMouseDisplayOptionName:(NSString *)displayOptionName {
mouseEventVisualizer.currentMouseDisplayOptionName = displayOptionName;

[[NSNotificationCenter defaultCenter] postNotificationName:@"KCMouseEventsSettingChanged" object:nil];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This shouldn't be needed.

Comment on lines +51 to +65


- (BOOL)mouseEnabled {
NSInteger displayOption = [[NSUserDefaults standardUserDefaults] integerForKey:@"mouse.displayOption"];

// 2: With Current Visualizer
// 3: With Pointer and Visualizer
if (displayOption == 2 || displayOption == 3) {
return YES;
}
else {
return NO;
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

not needed

CGFloat width = kDefaultDimension;
CGFloat width = [ud integerForKey:@"minimal.bezelSize"];

if (_mouse && [self mouseEnabled]) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

again don't need the mouseEnabled check, we'll either have a mouse event here or not, as appropriate

Comment on lines +190 to +205
// Remove flags that shouldn't be shown
if (![ud boolForKey:@"minimal.display.command"]) {
flags &= ~NSEventModifierFlagCommand;
}
if (![ud boolForKey:@"minimal.display.shift"]) {
flags &= ~NSEventModifierFlagShift;
}
if (![ud boolForKey:@"minimal.display.option"]) {
flags &= ~NSEventModifierFlagOption;
}
if (![ud boolForKey:@"minimal.display.control"]) {
flags &= ~NSEventModifierFlagControl;
}
if (![ud boolForKey:@"minimal.display.function"]) {
flags &= ~NSEventModifierFlagFunction;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sold on this as a UX choice but appreciate the effort for now

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.

3 participants