mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-01-12 02:21:49 +00:00
hack: prevent spacebar interactions in player UI
This commit is contained in:
parent
d06c20ae52
commit
1eef1f25fe
3 changed files with 7 additions and 4 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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>>) {
|
||||
|
|
|
|||
|
|
@ -492,7 +492,10 @@
|
|||
desc: 'Toggle Stats'
|
||||
},
|
||||
Space: {
|
||||
fn: () => playPause(),
|
||||
fn: (e) => {
|
||||
e.preventDefault()
|
||||
playPause()
|
||||
},
|
||||
id: 'play_arrow',
|
||||
icon: Play,
|
||||
type: 'icon',
|
||||
|
|
|
|||
Loading…
Reference in a new issue