working mouse

This commit is contained in:
2017-09-04 22:53:29 +02:00
parent 58ed6098c4
commit 7aa3cd7f75
5 changed files with 24 additions and 12 deletions
+3
View File
@@ -2244,11 +2244,13 @@ var Input = (function() {
if (b > 3 || b < 1) return;
var m = packModifiersForMouse();
Conn.send("p" + encode2B(y) + encode2B(x) + encode2B(b) + encode2B(m));
console.log("B ",b," M ",m);
},
onMouseUp: function (x, y, b) {
if (b > 3 || b < 1) return;
var m = packModifiersForMouse();
Conn.send("r" + encode2B(y) + encode2B(x) + encode2B(b) + encode2B(m));
console.log("B ",b," M ",m);
},
onMouseWheel: function (x, y, dir) {
// -1 ... btn 4 (away from user)
@@ -2256,6 +2258,7 @@ var Input = (function() {
var m = packModifiersForMouse();
var b = (dir < 0 ? 4 : 5);
Conn.send("p" + encode2B(y) + encode2B(x) + encode2B(b) + encode2B(m));
console.log("B ",b," M ",m);
},
};
})();