All skills
thedivergentai avatar

/godot-platform-desktop

@9d6e91e
by Divergent AIthedivergentai/gd-agentic-skills783 stars
48

Expert blueprint for desktop platforms (Windows/Linux/macOS) covering keyboard/mouse controls, settings menus, window management (fullscreen, resolution), keybind remapping, and Steam integration. Use when targeting PC platforms or implementing desktop-specific features. Keywords desktop, Windows, Linux, macOS, settings, keybinds, ConfigFile, DisplayServer, Steam, fullscreen.

Use this Skill: https://skilld.dev/gh/thedivergentai/gd-agentic-skills/godot-platform-desktop

This session only. Nothing lands on disk.

SKILL.md

โ‰ˆ101 tokens always: the name and description. โ‰ˆ2.7k when used: this file. โ‰ˆ1.3k more on demand in 2 files.

Platform: Desktop

Settings flexibility, window management, and kb/mouse precision define desktop gaming.

NEVER Do (Expert Desktop Rules)

Window & Display

  • NEVER hardcode resolution or fullscreen modes โ€” Always provide a settings menu with resolution + mode toggle.
  • NEVER ignore DPI scale factors โ€” Use DisplayServer.screen_get_scale() / usable rects.
  • NEVER skip a borderless window option โ€” Offer WINDOW_MODE_FULLSCREEN (borderless) for multi-monitor focus.

Input & Persistence

  • NEVER use keycode for movement rebinds โ€” Use physical_keycode for AZERTY/Dvorak.
  • NEVER save settings or user data to res:// โ€” Always user://.
  • NEVER skip NOTIFICATION_WM_CLOSE_REQUEST โ€” Flush ConfigFile before get_tree().quit().

Performance & Integration

  • NEVER run utility tools at max framerate โ€” Enable OS.low_processor_usage_mode for static tools.
  • NEVER call proprietary SDKs (Steam/Epic) directly โ€” Wrap with Engine.has_singleton() guards.
  • NEVER block the main thread with massive I/O โ€” Offload to WorkerThreadPool.

Available Scripts

MANDATORY: Read the appropriate script before implementing the corresponding pattern. Do not paste inline settings/rebind/Steam tutorials โ€” the scripts are the golden path.

desktop_window_manager.gd

Expert DPI-aware multi-monitor window positioning using DisplayServer.

desktop_settings_persistent.gd

Production settings persistence using ConfigFile for persistent INI data.

physical_input_rebinder.gd

Expert positional rebind system using physical_keycode for AZERTY/Dvorak.

platform_sdk_wrapper.gd

Safe PC SDK singleton wrapper (Steamworks/Epic) with crash guards.

native_dialog_helper.gd

Expert native OS file dialogs and system alerts logic.

secondary_window_spawner.gd

True multi-window management for secondary Viewports/Windows.

graceful_shutdown_handler.gd

Safe close-request interceptor for data flushing and exit guards.

low_processor_eco_mode.gd

Eco mode optimization for desktop tools and launchers.

desktop_performance_monitor.gd

OS-level hardware detection for dynamic graphics presets.

native_shell_executor.gd

Expert native shell command execution and output capture.


Desktop Golden Path (MANDATORY scripts)

  1. Resolution / stretch โ€” use the mini-tree below, then MANDATORY desktop_window_manager.gd.
  2. Window / DPI โ€” MANDATORY desktop_window_manager.gd: multi-monitor position, scale, mode restore.
  3. ConfigFile settings โ€” MANDATORY desktop_settings_persistent.gd: graphics/audio/window under user://.
  4. Physical rebinds โ€” MANDATORY physical_input_rebinder.gd: physical_keycode only.
  5. Close flush โ€” MANDATORY graceful_shutdown_handler.gd: NOTIFICATION_WM_CLOSE_REQUEST โ†’ save โ†’ quit.
  6. Store SDK โ€” MANDATORY platform_sdk_wrapper.gd before any store call: if Engine.has_singleton("Steam") โ†’ Steam API; elif Engine.has_singleton("EOS") โ†’ Epic; else no-op stub. Gate features with export feature tags (steam / epic).

Resolution / stretch mini-tree

Player need Window mode Script hook
Fullscreen game, alt-tab friendly WINDOW_MODE_FULLSCREEN (borderless) desktop_window_manager.gd
Exclusive fullscreen (lowest latency) WINDOW_MODE_EXCLUSIVE_FULLSCREEN Same โ€” persist choice in ConfigFile
Windowed / multi-monitor drag WINDOW_MODE_WINDOWED + usable rect / DPI scale Same + desktop_settings_persistent.gd

CI smoke: headless --path . --quit-after 1 with settings round-trip write/read under user:// before merge (pairs with godot-export-builds).

Expert Callouts (keep short โ€” not full tutorials)

1. Alt-Tab stuck-input guard

On NOTIFICATION_APPLICATION_FOCUS_OUT, pause and Input.action_release held movement actions so OS-swallowed key-ups do not strand velocity.

2. Desktop launcher note

Lightweight launcher projects may OS.create_process the main pack after writing user://settings.cfg; pair with low_processor_eco_mode.gd while idle in menus.

Deep dives (on demand)

Reference

Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing work to a peer domain โ€” do not preload the whole lattice.

Official Documentation

  • DisplayServer โ€” Window modes, screen_get_scale / usable rects, and native file-dialog features behind multi-monitor and HiDPI desktop settings.
  • Multiple resolutions โ€” Stretch modes, aspect, and content scale so resolution dropdowns stay sharp across 1080pโ€“4K displays.
  • Handling quit requests โ€” NOTIFICATION_WM_CLOSE_REQUEST / set_auto_accept_quit(false) so Alt+F4 and window-close flush ConfigFile before exit.
  • ConfigFile โ€” INI-style persistence for graphics, audio, and window state under user://.
  • File paths in Godot projects โ€” Why settings and saves must use user:// (exported res:// is read-only).
  • InputEventKey โ€” physical_keycode vs keycode so WASD rebinds survive AZERTY/Dvorak layouts.
  • InputMap โ€” Runtime action_erase_events / action_add_event for desktop rebind UIs.
  • Using InputEvent โ€” Focus-loss stuck-key pitfalls (NOTIFICATION_APPLICATION_FOCUS_OUT) when Alt-Tabbing on PC.
  • Window โ€” Secondary/tool windows and mode/size/position restore for true multi-window desktop apps.
  • OS โ€” low_processor_usage_mode, create_process / execute, and alert for launchers and native shell hooks.
  • Creating applications โ€” Desktop-style app chrome, dialogs, and quit UX beyond game-only loops.
  • Engine โ€” has_singleton / get_singleton guards so Steam/Epic GDExtensions never crash standalone builds.

Related Skills

Prerequisites
  • godot-project-foundations โ€” Display stretch, feature tags (windows/linux/macos), and project defaults every desktop settings menu depends on.
  • godot-input-handling โ€” InputEvent buffering and action design before wiring physical_keycode rebind UIs.
  • godot-ui-containers โ€” Settings screens, dropdowns, and remapper rows that stay layout-correct across resolutions.
Complements
Downstream / consumers
  • godot-export-builds โ€” Windows/Linux/macOS export presets, icons, and store packaging once desktop settings and SDK wrappers are stable.
  • godot-platform-mobile โ€” Sibling platform skill for dual-target projects that must not assume desktop quit/window APIs on phones.
  • godot-platform-web โ€” Browser constraints (no multi-window / limited shell) when shipping the same settings stack to HTML5.
Master
  • godot-master โ€” Library router and mirrored module entry for discovering this platform skill beside sibling domains.

Source: SKILL.md on GitHub

1 warning17d5 checks ยท Risk MEDIUM
  • Gen Agent Trust Hub17d

    The skill provides comprehensive desktop integration tools for Godot, including shell command execution, process management, and screen pixel sampling. While designed for application development, these high-privilege capabilities represent a significant security surface that could be leveraged for data exfiltration or unauthorized system operations if integrated into an autonomous agent without strict oversight.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW ยท No issues

  • Runlayer7mo

    2/2 files flagged

  • ZeroLeaks5mo

    Score: 93/100 ยท 2 sections analyzed

Signed by skilld at 9d6e91e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 2 months ago

README badge

README badge for thedivergentai/gd-agentic-skills/godot-platform-desktop