Offer mouse drawing when the mouse reaches for the toolbar - #82
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
IsDefaultorIsCancel, and Enter is swallowed. A focused non-defaultButtonresponding to Enter is version- and style-dependent, so rather than rely on it not firing,Window_PreviewKeyDownmarks every Enter handled — it tunnels from the Window before any button'sKeyDown— and invokes a button only whenKeyboard.FocusedElementis one of ours. Enter with nothing focused, or with the checkbox focused, does nothing and leaves the dialog open.Keyboard.Focus(this)inLoaded, 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
SuggestMouseModesetting (settings version 13 → 14) with a Preferences entry under Input, because "don't show again" is otherwise a one-way door.WarnWhenNoDigitizersets the precedent.Enable mouse mode sets
MouseMode.Onrather thanWhenNoDigitizer, 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