chore(control): change to new keyboard_input api

This commit is contained in:
E44
2026-01-08 18:05:58 +01:00
parent 1bd76c666d
commit 754f466d73
3 changed files with 57 additions and 10 deletions
+15 -2
View File
@@ -96,6 +96,19 @@
false
);
}
async function send_single_key_press(key: string) {
await run_on_all_selected_displays((d) =>
send_keyboard_input(d.ip, [{ key, action: 'press' }])
);
setTimeout(
async () =>
await run_on_all_selected_displays((d) =>
send_keyboard_input(d.ip, [{ key, action: 'release' }])
),
10
);
}
</script>
{#snippet ask_shutdonw_popup()}
@@ -137,7 +150,7 @@
className="px-9"
disabled={$selected_display_ids.length === 0}
click_function={async () => {
await run_on_all_selected_displays((d) => send_keyboard_input(d.ip, 'VK_LEFT'));
await send_single_key_press('VK_LEFT');
}}><ArrowBigLeft /></Button
>
<Button
@@ -145,7 +158,7 @@
className="px-9"
disabled={$selected_display_ids.length === 0}
click_function={async () => {
await run_on_all_selected_displays((d) => send_keyboard_input(d.ip, 'VK_RIGHT'));
await send_single_key_press('VK_RIGHT');
}}><ArrowBigRight /></Button
>
</div>