BreeceW/WinUIEdit

Touch/Pen Support

Opened this issue · 1 comments

Here are some features I wanted for touch/pen support, to maintain similar behavior with RichEditBox in WinUI.

  1. Touch/Pen dragging up and down should scroll instead of selecting text.
  2. Double Tapping should work with a slightly different position. In other words, it is hard for touch users to double tab in the exact same pixel.
  3. This one will be tricky and maybe low priority. For touch, double tab to select the text, and have these two circles that can be dragged around (Referencing the image). For pen, "right-click drag" to select the text, and also shows the two circles that can be dragged around too.
    Screenshot 2023-03-18 230809

Drag to scroll for touch is something I plan on adding. I think the best way to do that would be with XAML manipulation events.

Scintilla already handles the scenario where double clicking isn’t at the exact same pixel, but WinUIEdit does seem like it isn’t responding as well to double click as the Scintilla reference editor on win32. It’s possible that Windows is doing some kind of emulation for intercepting touch double taps and converting them to exact double clicks, but that’s just a guess. We can probably just increase the double click distance threshold in ScintillaWinUI and be fine. doubleClickCloseThreshold

Drag handles would certainly be a larger undertaking and would might require forking Scintilla code. As a long-term goal, I do want full touch support. Update: WinUI draws text handles using a Canvas, two ellipses, and a rectangle. We can reference the code in dxaml\xcp\core\text\common\Gripper.cpp in WinUI 3 to make an exact replica.