event.buttons is always 1 in mousemove event, even if no button is pressed
jibalamy opened this issue · comments
jibalamy commented
Hello,
In mousemove event, event.buttons is always 1, even if no button is pressed.
In the following code, I see only "1" in the console when moving the mouse around without pressing button. I tested it with FireFox and Chrome.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="brython.js"></script>
<script type="text/javascript" src="brython_stdlib.js"></script>
</head>
<body>
<script type="text/python">
from browser import document
document <= "Hello"
def on_mousemove(event):
print(event.buttons)
document.bind("mousemove", on_mousemove)
</script></body></html>
Pierre Quentel commented
Sorry, I can't reproduce the bug. The code shows 0 when moving the mouse without pushing any button, 1 when pushing the left button, 3 when pushing left and right at the same time, etc. Tested on Chrome and Firefox.
jibalamy commented
After rebooting my computer, the problem disappeared.
Sorry for that :-(