fix space key to play
This commit is contained in:
parent
5abddb0a22
commit
21dac9f09e
|
|
@ -206,6 +206,9 @@ function getPressedKey(ev: KeyboardEvent): string | null {
|
|||
const key = (ev.key ?? "").toLowerCase();
|
||||
const code = ev.code ?? "";
|
||||
|
||||
if (code === "Space" || key === " " || key === "spacebar" || key === "space")
|
||||
return "space";
|
||||
|
||||
// Check arrow keys
|
||||
if (key.startsWith("arrow")) {
|
||||
return key.slice(5);
|
||||
|
|
@ -213,7 +216,6 @@ function getPressedKey(ev: KeyboardEvent): string | null {
|
|||
|
||||
// Check for special keys
|
||||
if (key === "tab") return "tab";
|
||||
if (key === " " || key === "space") return "space";
|
||||
if (key === "home") return "home";
|
||||
if (key === "end") return "end";
|
||||
if (key === "delete") return "delete";
|
||||
|
|
|
|||
Loading…
Reference in New Issue