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