feat: make keybinds configurable with omasnap.conf - #97
Open
TravonteD wants to merge 5 commits into
Open
Conversation
Editor shortcuts move from hardcoded Qt::Key checks to bindings loaded from a [keys] section in omasnap.conf, following the palette/output config pattern. Each action takes one key or a comma-separated list, so the aliases keep working by default (marker=C,M; redo=Ctrl+Shift+Z, Ctrl+Y; zoom +/=/Ctrl+=). Matching is exact on key plus modifiers, and keypad bits never distinguish. Any unparsable value or a key bound to two actions of the same phase rejects the whole section back to defaults with a warning naming the offender; cross-phase reuse stays legal (R restores a region while selecting, draws rectangles while editing). Status lines, tooltips, and the hotkey legend read the primary binding through keyHint(), so hints follow rebinds instead of lying about keys. Pin-window and scrolling-panel keys stay fixed.
"marker =" now removes the marker's keys instead of being treated like an absent line. Missing names still keep their defaults, and unbinding one action leaves the rest alone.
TravonteD
force-pushed
the
configurable-keybinds
branch
from
August 27, 2026 13:57
589b51e to
866d08f
Compare
The smoke binary loaded keybindings from the developer's real ~/.config/omasnap/omasnap.conf, so a personal [keys] override (e.g. cycle-tab=Tab) silently flipped the bindings the suite asserts on and broke the select-phase undim-hole checks. Point XDG_CONFIG_HOME at a scratch dir so the editor reads its defaults instead of the host's. Also add Ctrl+0 as a ZoomFit alias: the suite asserts Ctrl+0 restores the fitted view and the README documents "0 (also with Ctrl)", matching the existing Ctrl+=/Ctrl+- zoom aliases. Co-Authored-By: OpenCode <noreply@opencode.ai>
TravonteD
force-pushed
the
configurable-keybinds
branch
from
August 27, 2026 13:57
866d08f to
2f4dcf1
Compare
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.
Problem:
Existing key-bindings can clash with the custom key-bindings that a user may have on their system already.
Solution:
Allow users to set custom key bindings via the configuration file.