fix(nds): really case insensitive input

This commit is contained in:
2026-02-08 20:11:53 +01:00
parent 8e3bf01828
commit 4de10dd309
2 changed files with 12 additions and 4 deletions

View File

@@ -24,6 +24,10 @@ const keyToButton: Record<string, string> = {
s: "B",
z: "X",
q: "Y",
D: "A",
S: "B",
Z: "X",
Q: "Y",
" ": "SELECT",
Enter: "START",
};
@@ -34,7 +38,7 @@ const keyToButton: Record<string, string> = {
// like who choose Nuxt to build such an app
useKeyDown((key) => {
if (app.settings.renderingMode === "3d") return;
const button = keyToButton[key.toLowerCase()];
const button = keyToButton[key];
if (button) {
window.dispatchEvent(
new KeyboardEvent("keydown", { key: `NDS_${button}` }),
@@ -60,7 +64,7 @@ useKeyDown((key) => {
useKeyUp((key) => {
if (app.settings.renderingMode === "3d") return;
const button = keyToButton[key.toLowerCase()];
const button = keyToButton[key];
if (button) {
window.dispatchEvent(new KeyboardEvent("keyup", { key: `NDS_${button}` }));
}