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"),
]; 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 type="text/javascript">

View File

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

View File

@ -5,11 +5,26 @@
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
<script type = text/javascript>
window.addEventListener("load", function() {
window.classicConfig = ["game","resources.mc"];
main();
});
</script>
window.addEventListener("load", function() {
window.classicConfig = ["game","resources.mc"];
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>
</head>
<body style="margin:0px;width:100vw;height:100vh;" id="game">
</body>