fixed click, mod rate changes

This commit is contained in:
Maxim Stewart 2020-06-28 23:04:16 -05:00
parent b53db698a6
commit 74da483bc5
2 changed files with 15 additions and 8 deletions

View File

@ -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

View File

@ -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);