Search code examples
ace-editor

How to check if the mouse is down in AceEditor


I run computationally expensive code when the cursor changes and this becomes obvious when the user is selecting a lot of text.

I'd like to know if the mouse is down or up so I can ignore the cursor change events if the user is dragging. When they let go of the mouse down button I can run my code on mouse up or on cursor change events when the mouse is up.

Is there a way to tell if the mouse is down in ace editor?


Solution

  • There is editor.$mouseHandler.isMousePressed property.