hawkerm / monaco-editor-uwp

A Windows Runtime Component wrapper around the web-based Monaco Editor.
MIT License
152 stars 36 forks source link

Add Monaco Editor Mouse Events #43

Open hawkerm opened 4 years ago

hawkerm commented 4 years ago

In the XmlSyntaxVisualizerUWP example we couldn't detect the cursor moving from a mouse click:

Cursor position doesn't update on click, only on keyboard caret move/edit.

If we can expose knowing when the user clicks in the editor, then we can just call get caret position method or something. Need to investigate this scenario more.

hawkerm commented 4 years ago

Hmm, the scenario for the visualizer may work through the SelectedRange property like we do in the sample here, even if we don't expose the click event itself...

The Editor's GotFocus and LostFocus events also work.

hawkerm commented 4 years ago

Think for the original scenario for the XmlSyntaxVisualizer, we're sufficient for now, so going to move this out of v0.9-beta.

However, going to leave this here, as we probably want to implement the actual Monaco onMouseDown event as it contains a lot of context about where in the editor the user clicked.