fix(nds): really case insensitive input
This commit is contained in:
@@ -212,12 +212,16 @@ const keyToButton: Record<string, string> = {
|
||||
s: "B",
|
||||
w: "X",
|
||||
a: "Y",
|
||||
D: "A",
|
||||
S: "B",
|
||||
W: "X",
|
||||
A: "Y",
|
||||
" ": "SELECT",
|
||||
Enter: "START",
|
||||
};
|
||||
|
||||
useKeyDown((key) => {
|
||||
const button = keyToButton[key.toLowerCase()];
|
||||
const button = keyToButton[key];
|
||||
if (button) {
|
||||
physicalButtonsDown.add(button);
|
||||
window.dispatchEvent(
|
||||
@@ -227,7 +231,7 @@ useKeyDown((key) => {
|
||||
});
|
||||
|
||||
useKeyUp((key) => {
|
||||
const button = keyToButton[key.toLowerCase()];
|
||||
const button = keyToButton[key];
|
||||
if (button) {
|
||||
physicalButtonsDown.delete(button);
|
||||
window.dispatchEvent(new KeyboardEvent("keyup", { key: `NDS_${button}` }));
|
||||
|
||||
Reference in New Issue
Block a user