mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-25 18:22:54 +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",
|
"name": "ui",
|
||||||
"version": "6.3.49",
|
"version": "6.3.50",
|
||||||
"license": "BUSL-1.1",
|
"license": "BUSL-1.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@9.14.4",
|
"packageManager": "pnpm@9.14.4",
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
import { keys, layout, type KeyCode } from './maps.ts'
|
import { keys, layout, type KeyCode } from './maps.ts'
|
||||||
|
|
||||||
type Bind <T extends Record<string, unknown> = Record<string, unknown>> = T & {
|
type Bind <T extends Record<string, unknown> = Record<string, unknown>> = T & {
|
||||||
fn: () => void
|
fn: (e: MouseEvent | KeyboardEvent) => void
|
||||||
id: string
|
id: string
|
||||||
code?: KeyCode
|
code?: KeyCode
|
||||||
}
|
}
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
async function runBind (e: MouseEvent | KeyboardEvent, code: KeyCode) {
|
async function runBind (e: MouseEvent | KeyboardEvent, code: KeyCode) {
|
||||||
if ('repeat' in e && e.repeat) return
|
if ('repeat' in e && e.repeat) return
|
||||||
const kbn = get(binds)
|
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>>) {
|
export function loadWithDefaults (defaults: Partial<Record<string, Bind>>) {
|
||||||
|
|
|
||||||
|
|
@ -492,7 +492,10 @@
|
||||||
desc: 'Toggle Stats'
|
desc: 'Toggle Stats'
|
||||||
},
|
},
|
||||||
Space: {
|
Space: {
|
||||||
fn: () => playPause(),
|
fn: (e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
playPause()
|
||||||
|
},
|
||||||
id: 'play_arrow',
|
id: 'play_arrow',
|
||||||
icon: Play,
|
icon: Play,
|
||||||
type: 'icon',
|
type: 'icon',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue