Skip to content

Normalize duplicate keyboard shortcut bindings on load#665

Merged
ten9876 merged 1 commit into
aethersdr:mainfrom
jensenpat:shortcut-normalize
Apr 4, 2026
Merged

Normalize duplicate keyboard shortcut bindings on load#665
ten9876 merged 1 commit into
aethersdr:mainfrom
jensenpat:shortcut-normalize

Conversation

@jensenpat

Copy link
Copy Markdown
Collaborator

Summary

This fixes a keyboard shortcut edge case where duplicate saved bindings can leave a key non-functional or unreliable at runtime.

Problem

Shortcut bindings are loaded from settings without conflict resolution. If two actions end up saved with the same key, ShortcutManager rebuilds multiple QShortcuts for that key. In practice that can make the key behave ambiguously.

One real example was:

  • mode_lsb = L
  • lock_toggle = L

That let USB work with its unique binding while LSB appeared broken.

Fix

During ShortcutManager load, normalize duplicate key assignments before shortcuts are rebuilt:

  • keep the first unique binding for each key
  • if a duplicate exists, prefer an explicit customized binding over a default binding
  • clear the losing duplicate and save the normalized settings back out

Why this is low risk

  • only affects invalid duplicate bindings already present in saved settings
  • does not change normal shortcut behavior for valid unique bindings
  • uses existing QtCore APIs only, with no dependency or build-system changes

Validation

  • reproduced the issue by inspecting saved shortcut settings with both mode_lsb and lock_toggle bound to L
  • isolated the fix onto a clean branch from main
  • verified the branch contains only the ShortcutManager change

@jensenpat jensenpat marked this pull request as ready for review April 4, 2026 14:32
@jensenpat jensenpat changed the title Normalize duplicate shortcut bindings on load Normalize duplicate keyboard shortcut bindings on load Apr 4, 2026
@ten9876 ten9876 merged commit bfe4ff0 into aethersdr:main Apr 4, 2026
3 checks passed
@jensenpat jensenpat deleted the shortcut-normalize branch April 4, 2026 17:43
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