|
14 | 14 | import ws from '$lib/websocket/ws'; |
15 | 15 | import { IS_RUNNING_EXTERNAL } from '$lib/detection/onwebsite'; |
16 | 16 | import Tooltip from '$lib/layout/Tooltip.svelte'; |
| 17 | + import MouseIcon from '$lib/layout/icons/MouseIcon.svelte'; |
17 | 18 | // import { GetAudioProcess, SetAudioPid } from '$lib/wailsjs/go/bindings/App'; |
18 | 19 |
|
19 | 20 | let selected_audio_src = $state(0) |
|
62 | 63 | |
63 | 64 | let keyboardEnabled = $state(false); |
64 | 65 | let gamepadEnabled = $state(true); |
| 66 | + let mouseEnabled = $state(false); |
65 | 67 |
|
66 | 68 | function createStream() { |
67 | 69 | CreateHostStream(selected_resolution, idealFramerate, maxFramerate); |
|
93 | 95 | await ToogleGamepad() |
94 | 96 | gamepadEnabled = await IsGamepadEnabled() |
95 | 97 | } |
| 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 | + } |
96 | 106 |
|
97 | 107 | function MapAudioSrcs (s: audio.AudioProcess) { |
98 | 108 | if (s.Name.length > 0) return s |
|
165 | 175 | {$_('toogle_devices')} |
166 | 176 | </h3> |
167 | 177 | <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"> |
169 | 182 | <KeyboardIcon/> |
170 | 183 | </button> |
171 | 184 | <button onclick={toogleGamepad} class:btn-primary={gamepadEnabled} class:btn-neutral={!gamepadEnabled} class:border-gray-400={!gamepadEnabled} class="btn border"> |
|
0 commit comments