Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 667a44b0 authored by Simon Chan's avatar Simon Chan
Browse files

feat(demo): enable keyboard lock in full screen

parent 34d28fdc
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -77,9 +77,13 @@ const ITEMS = computed(() => {
        iconProps: { iconName: Icons.FullScreenMaximize },
        iconOnly: true,
        text: "Fullscreen",
        onClick: () => {
        onClick: (async () => {
            STATE.deviceView?.enterFullscreen();
        },
            if ("keyboard" in navigator) {
                // @ts-expect-error
                await navigator.keyboard.lock();
            }
        }) as () => void,
    });

    result.push(
+4 −0
Original line number Diff line number Diff line
@@ -368,6 +368,10 @@ export class ScrcpyPageState {
        clearTimeout(this.fpsCounterIntervalId);

        document.exitFullscreen().catch(NOOP);
        if ("keyboard" in navigator) {
            // @ts-expect-error
            navigator.keyboard.unlock();
        }

        this.client = undefined;
        this.running = false;