Skip to content

Keyboard shortcut conflict between R (Rotate) and Shift+R (Toggle Rapid) #3

Description

@nyampire

Summary

The R key (Rotate selected features) and Shift+R (Toggle Rapid data layer) may conflict in certain editing contexts.

Current Bindings

Key Action Registered In
R Rotate selected features modules/operations/rotate.js (line 79)
Shift+R Toggle Rapid dataset layer modules/ui/sections/data_layers.js (line 480)

How the Keybinding System Works

The keybinding system (modules/util/keybinding.js) uses a two-pass matching approach:

  1. First pass (lines 19-31): Checks shifted keybindings (Shift+R) - these have priority
  2. Second pass (lines 35-44): Falls back to unshifted keybindings (R)

The code comment (lines 14-17) states:

"Most key shortcuts will accept either lower or uppercase, so we don't strictly match on the shift key, but we prioritize shifted keybindings first, and fallback to unshifted only if no match."

Potential Issue

Due to the fallback behavior, pressing Shift+R could potentially trigger the Rotate operation as a fallback if the Toggle Rapid binding is not matched in the current context/mode. This needs testing to confirm the exact scenarios where the conflict manifests.

Steps to Reproduce

  1. Open Rapid editor
  2. Select a building feature
  3. Press Shift+R
  4. Observe whether the feature rotates or the Rapid layer toggles (or both)

Key Files

  • modules/util/keybinding.js - Keybinding matching logic (two-pass system)
  • modules/operations/rotate.js - Rotate operation (R key, line 79)
  • modules/ui/sections/data_layers.js - Toggle Rapid data (Shift+R, line 480)
  • data/shortcuts.json - Shortcut definitions

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions