hack: prevent spacebar interactions in player UI

This commit is contained in:
ThaUnknown 2025-06-08 14:53:38 +02:00
parent d06c20ae52
commit 1eef1f25fe
No known key found for this signature in database
3 changed files with 7 additions and 4 deletions

View file

@ -1,6 +1,6 @@
{
"name": "ui",
"version": "6.3.49",
"version": "6.3.50",
"license": "BUSL-1.1",
"private": true,
"packageManager": "pnpm@9.14.4",

View file

@ -6,7 +6,7 @@
import { keys, layout, type KeyCode } from './maps.ts'
type Bind <T extends Record<string, unknown> = Record<string, unknown>> = T & {
fn: () => void
fn: (e: MouseEvent | KeyboardEvent) => void
id: string
code?: KeyCode
}
@ -27,7 +27,7 @@
async function runBind (e: MouseEvent | KeyboardEvent, code: KeyCode) {
if ('repeat' in e && e.repeat) return
const kbn = get(binds)
if (await cnd(code)) kbn[layout[code] ?? code]?.fn()
if (await cnd(code)) kbn[layout[code] ?? code]?.fn(e)
}
export function loadWithDefaults (defaults: Partial<Record<string, Bind>>) {

View file

@ -492,7 +492,10 @@
desc: 'Toggle Stats'
},
Space: {
fn: () => playPause(),
fn: (e) => {
e.preventDefault()
playPause()
},
id: 'play_arrow',
icon: Play,
type: 'icon',