Skip to content

Offer mouse drawing when the mouse reaches for the toolbar - #82

Merged
marcosqlbi merged 1 commit into
mainfrom
feature/mouse-mode-prompt
Aug 31, 2026
Merged

Offer mouse drawing when the mouse reaches for the toolbar#82
marcosqlbi merged 1 commit into
mainfrom
feature/mouse-mode-prompt

Conversation

@marcosqlbi

Copy link
Copy Markdown
Collaborator

1.2.0 left Mouse drawing discoverable only in Preferences, which is the one place someone who does not know the feature exists will not look. The signal that they might want it is already in the application: picking a tool from the toolbar with the mouse. A pen user reaches for the palette with the pen, so a mouse arriving there is someone whose next stroke is going to disappoint them.

The dialog

MouseModeOfferWindow — "Draw with a mouse?", an unchecked Don't show me this again, and Enable mouse mode / Cancel.

The offer is a question, not a confirmation, and the two answers are not interchangeable: one changes what the left button means. So:

  • Neither button is IsDefault or IsCancel, and Enter is swallowed. A focused non-default Button responding to Enter is version- and style-dependent, so rather than rely on it not firing, Window_PreviewKeyDown marks every Enter handled — it tunnels from the Window before any button's KeyDown — and invokes a button only when Keyboard.FocusedElement is one of ours. Enter with nothing focused, or with the checkbox focused, does nothing and leaves the dialog open.
  • Escape closes, because dismissing is always safe.
  • Nothing is focused on open. Keyboard.Focus(this) in Loaded, so the first Tab reaches the checkbox rather than a primed button — otherwise the checkbox takes focus and a stray Space answers the wrong question.

Three judgment calls

  • Once a session. Prompting on every toolbar click would be intolerable; prompting once ever would lose someone not ready to decide. A Cancel answers this session, the checkbox answers every one after it.
  • The offer is queued at background priority, not shown from the click handler, so the click first does what it came to do. The tool is selected, and the dialog then explains why it may not behave as expected.
  • A SuggestMouseMode setting (settings version 13 → 14) with a Preferences entry under Input, because "don't show again" is otherwise a one-way door. WarnWhenNoDigitizer sets the precedent.

Enable mouse mode sets MouseMode.On rather than WhenNoDigitizer, because the offer can only have appeared where the automatic default already decided not to.

Decision 24 records all of it. Version is 1.2.1.

Verification

Build clean, Core smoke tests pass including the settings round-trip and the 13 → 14 upgrade. Those tests are UI-free, so the dialog's behaviour is not covered by them; the README gains a second validation list under Mouse drawing validation, and every item on it is about a key doing nothing — the part a later change is most likely to undo.

A slow-shutdown regression was investigated against this branch and did not reproduce on the maintainer's machine. A clean launch-and-close measures 85–358 ms. No change was made for it.

🤖 Generated with Claude Code

1.2.0 left Mouse drawing discoverable only in Preferences, which is the one
place someone who does not know the feature exists will not look. The signal
that they might want it is already in the application: picking a tool from
the toolbar with the mouse. A pen user reaches for the palette with the pen,
so a mouse arriving there is someone whose next stroke is going to
disappoint them.

The offer is a question, not a confirmation, and the two answers are not
interchangeable - one changes what the left button means. So neither button
is IsDefault and Enter is swallowed before it can reach one: it acts only on
a button the person has deliberately moved focus to. Escape closes, because
dismissing is always safe, and nothing is focused when the dialog opens, so
the first Tab reaches the checkbox rather than a primed button. Enable mouse
mode sets MouseMode.On rather than WhenNoDigitizer, because the offer can
only have appeared where the automatic default already decided not to.

Asked once a session however many tools are picked afterwards. The checkbox
is unchecked by default: a single Cancel is an answer for this session, not
for every one after it, and Help > Preferences > Input is the way back once
it has been declined for good.

The dialog is dispatched at background priority rather than shown from the
click handler, so the click first does what it came to do. The tool is
selected, and the dialog then explains why it may not behave as expected.

Decision 24, and a second validation list in the README - every item on it
is about a key doing nothing, which is the part a later change is most
likely to undo. Version is 1.2.1.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@marcosqlbi
marcosqlbi merged commit e169783 into main Aug 31, 2026
4 checks passed
@marcosqlbi
marcosqlbi deleted the feature/mouse-mode-prompt branch August 31, 2026 12:33
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.

1 participant