mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-03 14:42:21 +00:00
input.js: fix button index on mouse events
The buttonMask variable was useless and using it as the button index in the navigation events was nonsensical. In addition, the button index must be increased by one to map it to the X domain.
This commit is contained in:
parent
42f2ae7c2b
commit
3beb712e16
1 changed files with 1 additions and 13 deletions
14
www/input.js
14
www/input.js
|
@ -49,11 +49,6 @@ class Input {
|
|||
*/
|
||||
this.m = null;
|
||||
|
||||
/**
|
||||
* @type {Integer}
|
||||
*/
|
||||
this.buttonMask = 0;
|
||||
|
||||
/**
|
||||
* @type {Keyboard}
|
||||
*/
|
||||
|
@ -155,14 +150,7 @@ class Input {
|
|||
}
|
||||
|
||||
if (event.type === 'mousedown' || event.type === 'mouseup') {
|
||||
var mask = 1 << event.button;
|
||||
if (down) {
|
||||
this.buttonMask |= mask;
|
||||
} else {
|
||||
this.buttonMask &= ~mask;
|
||||
}
|
||||
|
||||
data["button"] = this.buttonMask;
|
||||
data["button"] = event.button + 1;
|
||||
}
|
||||
|
||||
data["x"] = this.x;
|
||||
|
|
Loading…
Reference in a new issue