Give Commit to Plate and the bed toggle a keyboard, on a Ctrl+Shift layer

Both were mouse-only: Commit to Plate is a toolbar button bound to wxEVT_BUTTON,
the bed is a CheckBox, and neither had an accelerator. That put them out of
reach of anything driving the keyboard, and out of reach of a hand that had not
already left the model to find them.

Ctrl+Shift, because the Shift+letter space is full to the last letter and
because the char hook deliberately ignores every Ctrl-combo -- which is exactly
what leaves this layer free to claim. P is Plate and B is Bed; neither collides
with OrcaSlicer own Ctrl+Shift+S (Save as) or Ctrl+Shift+G (Print plate), and
nothing else in the tree binds either.

The lookup goes ahead of the guard that drops Ctrl-combos, and nothing already
bound changes meaning: a plain Shift+letter still resolves as before, because
the new layer only answers when Ctrl is held as well.

The bed toggle drives the checkbox rather than the viewport alone, so the
control and the view cannot disagree about what is shown, and it says which it
did in the status line.

Both verified on the running build: Ctrl+Shift+B toggles the grid and the
checkbox together, Ctrl+Shift+P commits to Prepare.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tommaso Bianchi
2026-08-21 16:25:29 +02:00
co-authored by Claude Opus 5
parent eb66e45b7b
commit 3ad6d2fd50
2 changed files with 24 additions and 0 deletions
+4
View File
@@ -305,6 +305,10 @@ private:
// while a sketch is open (single letters = sketch tools); m_keys_feature fires only when
// no sketch is open (Shift+letter = feature tools; single letters = view toggles/section).
static constexpr int SC_SHIFT = 0x10000;
// ...and with 0x20000 when Ctrl is required too. The Shift+letter space is full, so an
// action that arrives late lives on Ctrl+Shift; plain Ctrl-combos are still passed
// straight through, which is what leaves this layer free.
static constexpr int SC_CTRL = 0x20000;
std::map<int, std::function<void()>> m_keys_sketch;
std::map<int, std::function<void()>> m_keys_feature;