mirror of
https://github.com/owenlejeune/AirHockey.git
synced 2025-12-26 09:21:18 -05:00
Event listener to prevent page scroll on key press added
This commit is contained in:
@@ -131,6 +131,12 @@ window.addEventListener("beforeunload", (e) => {
|
|||||||
leaveGame();
|
leaveGame();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.addEventListener("keydown", (e) => {
|
||||||
|
if(e.which == RIGHT_ARROW || e.which == LEFT_ARROW || e.which == UP_ARROW || e.which == DOWN_ARROW){
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function printSpectators(names){
|
function printSpectators(names){
|
||||||
var spectators = names;
|
var spectators = names;
|
||||||
console.log(spectators);
|
console.log(spectators);
|
||||||
|
|||||||
Reference in New Issue
Block a user