fixed click, mod rate changes
This commit is contained in:
parent
b53db698a6
commit
74da483bc5
|
@ -37,5 +37,4 @@ Windows
|
||||||
![1 Interface.... ](images/pic1.png)
|
![1 Interface.... ](images/pic1.png)
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
* Fix typing input
|
8 n/a
|
||||||
* Fix clicking lockup issues during touch
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ const socket = io();
|
||||||
let intervalTimer = null;
|
let intervalTimer = null;
|
||||||
let px = 0;
|
let px = 0;
|
||||||
let py = 0;
|
let py = 0;
|
||||||
let mod = 1;
|
let mod = 0;
|
||||||
|
|
||||||
|
|
||||||
socket.on('connect', function() {
|
socket.on('connect', function() {
|
||||||
|
@ -78,21 +78,29 @@ function touchHandler(event) {
|
||||||
|
|
||||||
function beginTimerModBump() {
|
function beginTimerModBump() {
|
||||||
intervalTimer = setInterval(function () {
|
intervalTimer = setInterval(function () {
|
||||||
mod += 1;
|
mod += 2;
|
||||||
}, 800);
|
}, 600);
|
||||||
}
|
}
|
||||||
|
|
||||||
function endTimerModBump() {
|
function endTimerModBump() {
|
||||||
clearInterval(intervalTimer);
|
clearInterval(intervalTimer);
|
||||||
mod = 1;
|
mod = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function singleClick() {
|
||||||
|
socket.emit('single_click', "");
|
||||||
|
}
|
||||||
|
|
||||||
|
function doubleClick() {
|
||||||
|
socket.emit('double_click', "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
document.addEventListener("mousedown", beginTimerModBump, true);
|
document.addEventListener("mousedown", beginTimerModBump, true);
|
||||||
document.addEventListener("mouseup", endTimerModBump, true);
|
document.addEventListener("mouseup", endTimerModBump, true);
|
||||||
|
|
||||||
|
|
||||||
document.addEventListener("touchstart", touchHandler, true);
|
document.addEventListener("touchstart", touchHandler, true);
|
||||||
document.addEventListener("touchmove", touchHandler, true);
|
document.addEventListener("touchmove", touchHandler, true);
|
||||||
document.addEventListener("touchend", touchHandler, true);
|
document.addEventListener("touchend", touchHandler, true);
|
||||||
document.addEventListener("touchcancel", touchHandler, true);
|
document.addEventListener("touchcancel", touchHandler, true);
|
||||||
|
document.getElementById("singleClickBtn").addEventListener("mouseup", singleClick, true);
|
||||||
|
document.getElementById("doubleClickBtn").addEventListener("mouseup", doubleClick, true);
|
||||||
|
|
Loading…
Reference in New Issue