mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-03-11 22:15:35 +00:00
This commit is contained in:
parent
c78b18c5e8
commit
8b88e23594
4 changed files with 8 additions and 7 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ui",
|
||||
"version": "6.3.54",
|
||||
"version": "6.3.55",
|
||||
"license": "BUSL-1.1",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@9.14.4",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
<script lang='ts'>
|
||||
|
||||
import { highEntropyValues } from '$lib/utils'
|
||||
|
||||
</script>
|
||||
|
||||
{#if highEntropyValues}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
export const binds = persisted<Partial<Record<KeyCode, Bind>>>('thaunknown/svelte-keybinds', {})
|
||||
|
||||
const noop = async (_: KeyCode) => true
|
||||
const noop = (_: KeyCode) => true
|
||||
|
||||
let cnd = noop
|
||||
|
||||
|
|
@ -22,12 +22,14 @@
|
|||
if (typeof fn === 'function') cnd = fn
|
||||
})
|
||||
|
||||
document.addEventListener('keydown', e => runBind(e, e.code as KeyCode))
|
||||
document.addEventListener('keydown', e => runBind(e, e.code as KeyCode), {
|
||||
capture: true
|
||||
})
|
||||
|
||||
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(e)
|
||||
if (cnd(code)) kbn[layout[code] ?? code]?.fn(e)
|
||||
}
|
||||
|
||||
export function loadWithDefaults (defaults: Partial<Record<string, Bind>>) {
|
||||
|
|
|
|||
|
|
@ -494,6 +494,8 @@
|
|||
Space: {
|
||||
fn: (e) => {
|
||||
e.preventDefault()
|
||||
e.stopImmediatePropagation()
|
||||
e.stopPropagation()
|
||||
playPause()
|
||||
},
|
||||
id: 'play_arrow',
|
||||
|
|
@ -646,7 +648,6 @@
|
|||
|
||||
const torrentstats = server.stats
|
||||
|
||||
// @ts-expect-error bad type infer
|
||||
$condition = () => !isMiniplayer
|
||||
|
||||
let ff = false
|
||||
|
|
|
|||
Loading…
Reference in a new issue