Forgot to add some code -_-

This commit is contained in:
PeytonPlayz595 2024-02-25 01:23:13 -05:00
parent 58eb41c1d8
commit 53566d9ad0
3 changed files with 35 additions and 8 deletions

View File

@ -8,6 +8,21 @@ window.addEventListener("load", function() {
"game_frame",createAssetURI("assets"), "game_frame",createAssetURI("assets"),
]; main(); ]; main();
}); });
document.esc = false;
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape') {
e.preventDefault();
document.esc = true;
}
});
document.addEventListener('keyup', function(e) {
if (e.key === 'Escape') {
e.preventDefault();
document.esc = false;
}
});
</script> </script>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -1846,9 +1846,6 @@ public class EaglerAdapterImpl2 {
} }
public static boolean escapeKeyPressed() { public static boolean escapeKeyPressed() {
if(escapeKeyPressed2()) {
System.out.println("Escape Key Pressed!");
}
return getEventKey() == 1 || escapeKeyPressed2(); return getEventKey() == 1 || escapeKeyPressed2();
} }

View File

@ -9,6 +9,21 @@
window.classicConfig = ["game","resources.mc"]; window.classicConfig = ["game","resources.mc"];
main(); main();
}); });
document.esc = false;
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape') {
e.preventDefault();
document.esc = true;
}
});
document.addEventListener('keyup', function(e) {
if (e.key === 'Escape') {
e.preventDefault();
document.esc = false;
}
});
</script> </script>
</head> </head>
<body style="margin:0px;width:100vw;height:100vh;" id="game"> <body style="margin:0px;width:100vw;height:100vh;" id="game">