Skip to content

Commit d8f8bf4

Browse files
committed
UI enable/disable mouse
1 parent 39b0372 commit d8f8bf4

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-mouse-icon lucide-mouse stroke-white"><rect x="5" y="2" width="14" height="20" rx="7"/><path d="M12 6v4"/></svg>

frontend/src/routes/mode/host/connection/+page.svelte

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import ws from '$lib/websocket/ws';
1515
import { IS_RUNNING_EXTERNAL } from '$lib/detection/onwebsite';
1616
import Tooltip from '$lib/layout/Tooltip.svelte';
17+
import MouseIcon from '$lib/layout/icons/MouseIcon.svelte';
1718
// import { GetAudioProcess, SetAudioPid } from '$lib/wailsjs/go/bindings/App';
1819
1920
let selected_audio_src = $state(0)
@@ -62,6 +63,7 @@
6263
6364
let keyboardEnabled = $state(false);
6465
let gamepadEnabled = $state(true);
66+
let mouseEnabled = $state(false);
6567
6668
function createStream() {
6769
CreateHostStream(selected_resolution, idealFramerate, maxFramerate);
@@ -93,6 +95,14 @@
9395
await ToogleGamepad()
9496
gamepadEnabled = await IsGamepadEnabled()
9597
}
98+
99+
async function toogleMouse() {
100+
101+
const { IsMouseEnabled, ToogleMouse } = await import('$lib/wailsjs/go/bindings/App')
102+
await ToogleMouse()
103+
mouseEnabled = await IsMouseEnabled()
104+
105+
}
96106
97107
function MapAudioSrcs (s: audio.AudioProcess) {
98108
if (s.Name.length > 0) return s
@@ -165,7 +175,10 @@
165175
{$_('toogle_devices')}
166176
</h3>
167177
<div class="flex flex-row justify-center gap-3 mt-6">
168-
<button onclick={toogleKeyboard} class:btn-primary={keyboardEnabled} class:btn-neutral={!keyboardEnabled} class:border-gray-400={!keyboardEnabled} class="btn border">
178+
<button onclick={toogleMouse} class:btn-primary={mouseEnabled} class:btn-neutral={!mouseEnabled} class:border-gray-400={!mouseEnabled} class="btn border">
179+
<MouseIcon/>
180+
</button>
181+
<button onclick={toogleKeyboard} class:btn-primary={keyboardEnabled} class:btn-neutral={!keyboardEnabled} class:border-gray-400={!keyboardEnabled} class="btn border">
169182
<KeyboardIcon/>
170183
</button>
171184
<button onclick={toogleGamepad} class:btn-primary={gamepadEnabled} class:btn-neutral={!gamepadEnabled} class:border-gray-400={!gamepadEnabled} class="btn border">

0 commit comments

Comments
 (0)