Alt-Keypress not marked as handled when rectangular selection is done #64
Labels
No labels
Area-Accessibility
Area-Build
Area-CodeCompletion
Area-Document
Area-Documentation
Area-Editing
Area-Folding
Area-Highlighting
Area-i18n
Area-Indentation
Area-NetFx
Area-Rendering
Area-Search
Area-Snippets
dependencies
duplicate
Feedback Needed
help wanted
invalid
Issue-Bug
Issue-Discussion
Issue-Enhancement
Issue-Performance
Issue-Question
on-hold
Resolution-Answered
Resolution-By Design
Resolution-Duplicate
Resolution-Fixed
Resolution-Won't Fix
Up-for-Grabs
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-icsharpcode/AvalonEdit#64
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In my application, I use AvalonEdit as text editor, whilst also having a third-party Ribbon control. That Ribbon control shows keyboard shortcuts when the user presses the Alt-Key. In general this works.
However, when doing a rectangular selection using the mouse (i.e. press Alt, drag with mouse, release Alt), the Alt-KeyUp event is not marked as handled by AvalonEdit. This results in the Ribbon incorrectly showing the keyboard shortcuts (since it seems that user simply pressed and released the Alt-Key).
I was able to make a workaround, via handlers for PreviewMouseLeftButtonDown and KeyUp (essentially trying to check if a rectangular selection had occurred). A better solution would be to fix this in the code (I can send a PR), but I don't know if you want such a change.
When creating a rectangular selection you first press [Alt] and then use the mouse or the keyboard to select text. When [Alt] is first pressed, we can't and shouldn't mark the key press as handled by AvalonEdit because it might be intentional to show the accessor keys. On the other hand it is impossible to go back in time and change our decision once selection via mouse or keyboard starts.
If you have a pull request/solution for this, you are welcome to provide it. However I don't see how we could fix this because we would end up eating all Alt key-presses.
Other editors like Notepad++ behave the same. The accessor keys in menu bars are simply less visible and therefore you never notice them while editing text.