mirror of
https://github.com/FlamedDogo99/EaglerMobile.git
synced 2024-11-12 15:26:05 -08:00
Forgot to add key events
This commit is contained in:
parent
f51bc7338a
commit
42f4ffac9b
|
@ -230,14 +230,17 @@ function insertCanvasElements() {
|
|||
startTouchX = touch.pageX;
|
||||
}
|
||||
let movementX = touch.pageX - startTouchX;
|
||||
console.log(movementX)
|
||||
if((movementX * 10) > window.innerHeight) {
|
||||
strafeRightButton.classList.add("active");
|
||||
strafeLeftButton.classList.remove("active");
|
||||
keyEvent("d", "keydown");
|
||||
keyEvent("a", "keyup");
|
||||
|
||||
} else if ((movementX * 10) < (0 - window.innerHeight)) {
|
||||
strafeLeftButton.classList.add("active");
|
||||
strafeRightButton.classList.remove("active");
|
||||
keyEvent("a", "keydown");
|
||||
keyEvent("d", "keyup");
|
||||
} else {
|
||||
strafeRightButton.classList.remove("active");
|
||||
strafeLeftButton.classList.remove("active");
|
||||
|
|
Loading…
Reference in New Issue
Block a user