Skip to content

feat!: generic key bindings - #555

Merged
RobertMueller2 merged 3 commits into
Satty-org:mainfrom
robertwidfen:feat/generic_key_bindings
Aug 8, 2026
Merged

feat!: generic key bindings#555
RobertMueller2 merged 3 commits into
Satty-org:mainfrom
robertwidfen:feat/generic_key_bindings

Conversation

@robertwidfen

Copy link
Copy Markdown
Collaborator

See issue #450.

Changes syntax for [keybinds] section in config file to

"key" = "tool-or-command"

Also adds:

  • bindings for all toolbar buttons
  • commands for size selection
  • automatic hint generation for all buttons

Removes:

  • layout independent key bindings - instead bind what you want
  • single letter binding restriction

Old style is still supported but will generate deprecation warnings.

The old code always sent key events into the IME handling before they were processed as key event. Thus there were two places for bindings, bindings with a modifier and single letter bindings. But IME is for text input, thus it is now only activated for the text tool.

@RobertMueller2

Copy link
Copy Markdown
Member

Good work, code looks good to me with just a few tiny inline remarks. Not that many for such a big change. What I tested worked. Difficult to try out everything 😄

IME still works as far as I can tell. But I'm not the greatest expert for it. I'm not sure if I should say "it still works", perhaps somebody else sees this and can confirm this.

@RobertMueller2 RobertMueller2 added this to the 0.22.0 milestone Jun 30, 2026
rokokol added a commit to rokokol/Satty that referenced this pull request Jul 4, 2026
The way tool styles, secondary modes and tool-specific actions are
accessed may be revamped (ideally with configurable keybindings) after
issue Satty-org#555, so mark this binding as experimental for now.
RobertMueller2 pushed a commit that referenced this pull request Jul 4, 2026
* feat: toggle text outline in inverted color with Alt

Tapping Alt while editing text toggles an outline drawn in the inverted
text color (255 - channel per RGB, alpha kept). The outline is rendered
by stroking each line with the inverted color underneath the fill, so it
forms a border around the glyphs, and it is preserved when the text is
committed.

To avoid interfering with Alt-based combos (e.g. Ctrl+Alt+Arrow to move
the text) and key auto-repeat, the toggle only fires on a genuine Alt
tap: press then release with no other key pressed in between.

* docs: flag Alt text outline as experimental

The way tool styles, secondary modes and tool-specific actions are
accessed may be revamped (ideally with configurable keybindings) after
issue #555, so mark this binding as experimental for now.

* feat: cycle text outline modes (none/inverted/contrast) with Alt

Replace the boolean outline flag with an OutlineMode enum that the Alt
tap cycles through: None -> Inverted -> Contrast -> None. Inverted keeps
the previous behaviour (per-channel 255 - value); Contrast picks black or
white based on the text color's perceived luminance (YIQ).

Co-authored idea by the maintainer.
@robertwidfen
robertwidfen force-pushed the feat/generic_key_bindings branch from aadb3d8 to 4f9ae1f Compare July 26, 2026 10:20
Comment thread src/keybindings.rs Outdated
Comment thread src/keybindings.rs Outdated
Comment thread src/ui/toolbars.rs Outdated
Comment thread src/keybindings.rs Outdated
@robertwidfen
robertwidfen force-pushed the feat/generic_key_bindings branch 3 times, most recently from 2234c5d to f25c30e Compare August 2, 2026 14:10
@RobertMueller2 RobertMueller2 modified the milestones: 0.22.0, 0.23.0 Aug 2, 2026
@robertwidfen
robertwidfen force-pushed the feat/generic_key_bindings branch from f25c30e to 4c6e218 Compare August 3, 2026 06:01
See issue Satty-org#450.

Changes syntax for [keybinds] section in config file to

    "key" = "tool-or-command"

Also adds:
- bindings for all toolbar buttons
- commands for size selection
- automatic hint generation for all buttons

Removes:
- layout independent key bindings - instead bind what you want
- single letter binding restriction

Old style is still supported but will generate deprecation warnings.

The old code always sent key events into the IME handling before
they were processed as key event.  Thus there were two places for
bindings, bindings with a modifier and single letter bindings.
But IME is for text input, thus it is now only activated for
the text tool.
@robertwidfen
robertwidfen force-pushed the feat/generic_key_bindings branch from 4c6e218 to 6e3c871 Compare August 4, 2026 16:38
@RobertMueller2
RobertMueller2 merged commit 70cbbbb into Satty-org:main Aug 8, 2026
3 checks passed
@RobertMueller2

Copy link
Copy Markdown
Member

lgtm 🎊

RobertMueller2 added a commit to RobertMueller2/Satty that referenced this pull request Aug 8, 2026
Closes: Satty-org#538

prereq for Satty-org#469

builds on Satty-org#555 because it makes no sense otherwise.

This allows grouping tools under one button.
E.g. arrow and line, rectangle and circle

Used FactoryComponent along with FactoryVecDeque because that simplified
reference storage on the toolbar.
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.

2 participants