Discussion:
GWT Mouse Events - Move event always follows a mouse up
Velusamy Velu
2018-09-01 17:12:46 UTC
Permalink
I have been noticing that lifting the mouse button causes GWT to register a
mouse move. Initially I thought it was my hand that makes the mouse move
slightly when lifting my index finger. Then I practiced for a while not to
move my hand while lifting my index finger. Then made many attempts
not-to-move mouse when lifting the pressure on the button. No success!

Then I started capturing the mouse and displayed it for each event. The
sequence of events were - Click LMB, move, wait, and lift finger from the
button. To my surprise the last point before pressing down, the point at
which mouse button was down, then the last point (this being the
unexpected) after lifting are all identical. Please check the attached
screen clip.

Any idea why this happens?

Thanks
- Velu
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Thomas Broyer
2018-09-02 08:44:22 UTC
Permalink
Could it just be the events your browser dispatches? Have you tried in pure JS?
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Velusamy Velu
2018-09-02 15:29:49 UTC
Permalink
I should have been more careful about what I claimed. Probably my claim
that "causes GWT to register a mouse move" is wrong. I think you are right,
those events are dispatched by the browser. I haven't tried JS yet.
Post by Thomas Broyer
Could it just be the events your browser dispatches? Have you tried in pure JS?
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Velusamy Velu
2018-09-02 17:39:02 UTC
Permalink
I did some experiments with JS as Thomas suggested. Found Chrome & Opera
firing a mouseMoved event in the end of the sequence: mouseDown, mouseMove,
mouseUp.

Firefox and MS Edge on the hand behaved as expected - means, the last fired
event was mouseUp.
Safari on Mac - is inconclusive. The touchpad works as expected, mouseUp
was the last event fired. With a mouse it's mixed.

Below is the test code.

<!DOCTYPE html>
<html>

<head>
<script>
function mouseDown() {
document.getElementById("myDiv").style.background = "red";
}

function mouseUp() {
document.getElementById("myDiv").style.background = "green";
}

function mouseMove() {
document.getElementById("myDiv").style.background = "blue";
}

function mouseOut() {
document.getElementById("myDiv").style.background = "white";
}
</script>

<style>
div {
height: 200px;
width: 50%;
background-color: powderblue;
font-family: Verdana;
border: 2px solid black;
}
</style>

</head>

<body>
<div id="myDiv" onmousedown="mouseDown()" onmouseup="mouseUp()"
onmousemove="mouseMove()" onmouseout="mouseOut()" />
</body>

</html>
Post by Velusamy Velu
I should have been more careful about what I claimed. Probably my claim
that "causes GWT to register a mouse move" is wrong. I think you are right,
those events are dispatched by the browser. I haven't tried JS yet.
Post by Thomas Broyer
Could it just be the events your browser dispatches? Have you tried in pure JS?
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Loading...