Skip to content

Add Fullscreen LAN Party Mode with shortcut lock, admin unlock, and Task Manager policy control#1

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/implement-lan-party-mode
Draft

Add Fullscreen LAN Party Mode with shortcut lock, admin unlock, and Task Manager policy control#1
Copilot wants to merge 2 commits into
masterfrom
copilot/implement-lan-party-mode

Conversation

Copilot AI commented May 20, 2026

Copy link
Copy Markdown

Pull requests are generally on pause because majority of code base is being rewritten for Playnite 11.

Smaller "safe" changes for P10 might get accepted based on what they and if they come with test coverage. If you plan to work on bigger changes, please discuss it first in related issue or on Discord, thank you.

This PR adds a LAN Party (kiosk) mode for Fullscreen that prevents users from escaping to the Windows desktop and requires an admin password to unlock/exit. It introduces global shortcut blocking, enforced fullscreen/topmost behavior, and optional Task Manager disable/restore handling.

  • Description
    • LAN Party settings (Fullscreen)
      • Added persisted settings for enabling mode, optional Task Manager policy toggle, and admin password hash.
      • Added UI controls in Fullscreen Input settings to enable mode and set/reset admin password.
    • Global lock controller
      • Added LanPartyModeController using WH_KEYBOARD_LL to block Alt+Tab, Alt+F4, Ctrl+Esc, Alt+Esc, and both Windows keys.
      • Enforces foreground/topmost state and prevents effective minimize while mode is active.
      • Applies/restores HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr when configured.
    • Secure unlock flow
      • Added dedicated password dialog (LanPartyPasswordWindow) using PasswordBox.
      • Fullscreen shutdown/close/switch-to-desktop paths now require successful admin password verification before unlocking and exiting mode.
    • Localization + project wiring
      • Added localization keys for LAN Party settings and unlock prompts.
      • Wired new security and window files into Fullscreen app project.
    • Targeted logic coverage
      • Added focused tests for shortcut-block decision logic and password hash/verification behavior.
internal static bool ShouldBlockShortcut(int virtualKey, bool altPressed, bool ctrlPressed)
{
    return virtualKey == 0x5B || // LWin
           virtualKey == 0x5C || // RWin
           (virtualKey == 0x09 && altPressed) ||   // Alt+Tab
           (virtualKey == 0x73 && altPressed) ||   // Alt+F4
           (virtualKey == 0x1B && (altPressed || ctrlPressed)); // Alt/Ctrl+Esc
}
Original prompt

Implement a 'LAN Party Mode' (Kiosk Mode) for Playnite.

In this mode, the user should be blocked from accessing the Windows desktop. Only a LAN party admin should be able to exit this mode by providing a password.

Specific requirements for implementation:

  1. Block system shortcuts like Alt+Tab, Windows Key, Alt+F4, and Ctrl+Esc using a low-level global keyboard hook (WH_KEYBOARD_LL via user32.dll).
  2. Ensure the application window remains Topmost and Fullscreen, fully covering the taskbar and preventing other windows from coming to the foreground.
  3. Implement a secure password prompt UI/overlay that requires an admin password to unlock, remove the hooks, and exit the LAN Party mode.
  4. (Optional but recommended) Handle disabling Task Manager via the Windows Registry (HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableTaskMgr) when entering this mode to prevent Ctrl+Alt+Del bypasses, and ensure it is reliably restored upon unlock or application exit.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Implement LAN party mode. In this mode user will be blocked to go to windows desktop. Only LAN party admin will be able to do this providing a password. Block alt+TAB and other necessery shortcuts.

Assistant: Implementing a "LAN Party" or "Kiosk" mode for a Windows desktop application like Playnite requires a few specific OS-level interventions, since Windows generally tries to prevent applications from easily locking out the user.

Since Playnite is a C# WPF application, here is the general approach you would need to take:

  1. Low-Level Keyboard Hook (WH_KEYBOARD_LL):
    To block system shortcuts like Alt + Tab, Windows Key, Ctrl + Esc, and Alt + F4, you need to implement a global keyboard hook using the SetWindowsHookEx function from user32.dll. When the hook detects these specific key combinations, it flags them as "handled" so Windows doesn't process them.

  2. Topmost / Fullscreen Window:
    The main window needs to be set to Topmost = true and maximized to cover the entire screen (including the taskbar). Playnite's Fullscreen mode already handles a lot of the UI scaling, but ensuring it aggressively stays on top prevents users from accessing the underlying desktop.

  3. Admin Password Overlay:
    You will need a secure UI dialog that can be triggered (perhaps via a hidden button or a specific non-blocked hotkey) that prompts for the LAN party Admin password. Once verified, the application would remove the keyboard hooks and either exit or drop back to standard desktop mode.

  4. Task Manager Blocking (Optional but recommended):
    Ctrl + Alt + Del is a hardware-level interrupt in Windows and cannot be blocked by a keyboard hook. To fully lock down a PC, you typically have to disable Task Manager via the Windows Registry (HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableTaskMgr) when the mode starts, and re-enable it when the admin unlocks it.

Would you like me to write the code for this and open a Pull Request?
If so, please reply with "create a pull request" and I will use the coding agent to explore the repository and implement this feature for you!

User: create a pull request

Assistant: I have prepared the GitHub Copilot coding agent to create this pull request; I am just waiting for you to approve the prompt in the dialog box to proceed.

This pull request was created from Copilot chat.

Agent-Logs-Url: https://github.com/jaroslaw-dutka/Playnite/sessions/f6b7369e-adec-4488-b6eb-000fa7a5ab8a

Co-authored-by: jaroslaw-dutka <40070136+jaroslaw-dutka@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement LAN Party Mode for Playnite Add Fullscreen LAN Party Mode with shortcut lock, admin unlock, and Task Manager policy control May 20, 2026
Copilot AI requested a review from jaroslaw-dutka May 20, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants