Reputation: 17878
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?
Upvotes: 0
Views: 602
Reputation: 2218
You can use event listeners on ace editor. The mousedown event should help you in this case.
editor.on("mousedown", function () {
console.log("mouse down");
});
Upvotes: 2