fix(nds): really case insensitive input
This commit is contained in:
@@ -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}` }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user