From faed169a01fb6a2244aa0b5bd1850646d7eeff9c Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Sun, 26 Jul 2026 17:48:11 +0200 Subject: [PATCH] Sketch dimensions: make Tab commit, instead of silently dropping what you typed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The inline editor special-cased Escape and Skip()ped every other key, so Tab fell through to wx's default navigation. Its popup frame holds exactly one control, so focus came straight back to that control with its text re-selected. Type 60, Tab, 40, Enter — expecting to fill two dimensions — and the 60 is gone: Tab neither committed it nor advanced, so the 40 just replaced the re-selected text. A re-selected field is pixel-identical to a freshly opened one, so nothing on screen says a number was dropped. Tab-to-next-dimension is what Onshape, SolidWorks and Fusion do, which is exactly why it is the key a user reaches for. Tab now calls do_commit(), the same path Enter takes; the caller's on_commit is already what walks to the next dimension. Verified by driving the GUI: 37 Tab 24 Enter now produces a 37.0 x 24.0 rectangle, where before it produced 24 and a mouse-derived value. snaporca-xah Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01LyRwbuq6fjn3VV9U9UvhBM --- src/slic3r/GUI/SketchInlineEditor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/slic3r/GUI/SketchInlineEditor.cpp b/src/slic3r/GUI/SketchInlineEditor.cpp index d329422281..4981c9643c 100644 --- a/src/slic3r/GUI/SketchInlineEditor.cpp +++ b/src/slic3r/GUI/SketchInlineEditor.cpp @@ -62,6 +62,12 @@ SketchInlineEditor::SketchInlineEditor(wxWindow* parent_canvas) m_ctrl->Bind(wxEVT_TEXT_ENTER, [this](wxCommandEvent&) { do_commit(); }); m_ctrl->Bind(wxEVT_KEY_DOWN, [this](wxKeyEvent& e) { if (e.GetKeyCode() == WXK_ESCAPE) do_cancel(); + // Tab commits, exactly like Enter — the caller's on_commit is what walks to the next + // dimension. Left to wx's default handling it navigated within this one-control popup, + // i.e. back to the same field with the text re-selected: typing 60, Tab, 40 looked like + // two dimensions entered and silently kept only the 40. Losing typed input with no + // visible difference from a committed field is the part that made this worth a key case. + else if (e.GetKeyCode() == WXK_TAB) do_commit(); else e.Skip(); }); }