mirror of
https://github.com/FlamedDogo99/EaglerMobile.git
synced 2024-11-24 04:56:04 -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;
|
startTouchX = touch.pageX;
|
||||||
}
|
}
|
||||||
let movementX = touch.pageX - startTouchX;
|
let movementX = touch.pageX - startTouchX;
|
||||||
console.log(movementX)
|
|
||||||
if((movementX * 10) > window.innerHeight) {
|
if((movementX * 10) > window.innerHeight) {
|
||||||
strafeRightButton.classList.add("active");
|
strafeRightButton.classList.add("active");
|
||||||
strafeLeftButton.classList.remove("active");
|
strafeLeftButton.classList.remove("active");
|
||||||
|
keyEvent("d", "keydown");
|
||||||
|
keyEvent("a", "keyup");
|
||||||
|
|
||||||
} else if ((movementX * 10) < (0 - window.innerHeight)) {
|
} else if ((movementX * 10) < (0 - window.innerHeight)) {
|
||||||
strafeLeftButton.classList.add("active");
|
strafeLeftButton.classList.add("active");
|
||||||
strafeRightButton.classList.remove("active");
|
strafeRightButton.classList.remove("active");
|
||||||
|
keyEvent("a", "keydown");
|
||||||
|
keyEvent("d", "keyup");
|
||||||
} else {
|
} else {
|
||||||
strafeRightButton.classList.remove("active");
|
strafeRightButton.classList.remove("active");
|
||||||
strafeLeftButton.classList.remove("active");
|
strafeLeftButton.classList.remove("active");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user