mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-06 00:47:09 +00:00
chore(control): Keyboard queue (#31)
Co-authored-by: 2mal3 <56305732+2mal3@users.noreply.github.com>
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
import { db } from '$lib/ts/database';
|
||||
import { liveQuery, type Observable } from 'dexie';
|
||||
import TextInput from '$lib/components/TextInput.svelte';
|
||||
import { add_to_keyboard_queue } from '$lib/ts/utils';
|
||||
|
||||
let all_display_states: Observable<'on' | 'off' | 'mixed'> | undefined = $state();
|
||||
$effect(() => {
|
||||
@@ -206,11 +207,11 @@
|
||||
? 'text-stone-500 cursor-not-allowed'
|
||||
: 'hover:bg-stone-600 active:bg-stone-500 cursor-pointer'} py-2 rounded-xl flex justify-center items-center transition-colors duration-200"
|
||||
disabled={$selected_display_ids.length === 0}
|
||||
onmousedown={async () => {
|
||||
await send_single_key_press('ArrowLeft', 'press');
|
||||
onmousedown={() => {
|
||||
add_to_keyboard_queue(async () => await send_single_key_press('ArrowLeft', 'press'));
|
||||
}}
|
||||
onmouseup={async () => {
|
||||
await send_single_key_press('ArrowLeft', 'release');
|
||||
onmouseup={() => {
|
||||
add_to_keyboard_queue(async () => await send_single_key_press('ArrowLeft', 'release'));
|
||||
}}
|
||||
>
|
||||
<ArrowBigLeft />
|
||||
@@ -222,11 +223,11 @@
|
||||
? 'text-stone-500 cursor-not-allowed'
|
||||
: 'hover:bg-stone-600 active:bg-stone-500 cursor-pointer'} py-2 rounded-xl flex justify-center items-center transition-colors duration-200"
|
||||
disabled={$selected_display_ids.length === 0}
|
||||
onmousedown={async () => {
|
||||
await send_single_key_press('ArrowRight', 'press');
|
||||
onmousedown={() => {
|
||||
add_to_keyboard_queue(async () => await send_single_key_press('ArrowRight', 'press'));
|
||||
}}
|
||||
onmouseup={async () => {
|
||||
await send_single_key_press('ArrowRight', 'release');
|
||||
onmouseup={() => {
|
||||
add_to_keyboard_queue(async () => await send_single_key_press('ArrowRight', 'release'));
|
||||
}}
|
||||
>
|
||||
<ArrowBigRight />
|
||||
|
||||
Reference in New Issue
Block a user