All skills
thedivergentai avatar

/godot-platform-desktop

@9d6e91e

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.

referencesdesktop-expert-patterns.md

≈639 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Desktop expert patterns

Full settings/rebind/Steam samples + alt-tab guard, GDExtension social hooks, launcher template.

ConfigFile settings menu

# settings.gd
extends Control

func _ready() -> void:
    load_settings()
    apply_settings()

func load_settings() -> void:
    var config := ConfigFile.new()
    config.load("user://settings.cfg")
    
    $Graphics/ResolutionDropdown.selected = config.get_value("graphics", "resolution", 0)
    $Graphics/FullscreenCheck.button_pressed = config.get_value("graphics", "fullscreen", false)
    $Audio/MasterSlider.value = config.get_value("audio", "master_volume", 1.0)

func save_settings() -> void:
    var config := ConfigFile.new()
    config.set_value("graphics", "resolution", $Graphics/ResolutionDropdown.selected)
    config.set_value("graphics", "fullscreen", $Graphics/FullscreenCheck.button_pressed)
    config.set_value("audio", "master_volume", $Audio/MasterSlider.value)
    config.save("user://settings.cfg")

func apply_settings() -> void:
    # Resolution
    var resolutions := [Vector2i(1920, 1080), Vector2i(2560, 1440), Vector2i(3840, 2160)]
    var resolution := resolutions[$Graphics/ResolutionDropdown.selected]
    get_window().size = resolution
    
    # Fullscreen
    if $Graphics/FullscreenCheck.button_pressed:
        DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
    else:
        DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
    
    # Audio
    AudioServer.set_bus_volume_db(0, linear_to_db($Audio/MasterSlider.value))

Keyboard Remapping


## Window Management

```gdscript

## Steam Integration (if using)

```gdscript

## Expert Techniques & Optimizations

### 1. Alt-Tab-Pause (Stuck Input Guard)
When a game loses focus, the OS may intercept "key up" events, leaving Godot's `Input` state stuck. Use `NOTIFICATION_APPLICATION_FOCUS_OUT` to pause the game and reset input logic.

```gdscript
func _notification(what: int) -> void:
    match what:
        NOTIFICATION_APPLICATION_FOCUS_OUT:
            get_tree().paused = true
            # Optional: Manually release critical actions
            Input.action_release("move_forward")
        NOTIFICATION_APPLICATION_FOCUS_IN:
            get_tree().paused = false

2. Social Integrations (GDExtension)

For Discord-RPC or Vapor network pipes, use GDExtension to bind native shared libraries (.dll, .so, .dylib) to Godot at runtime. This keeps the engine core small while enabling expert-level social features.

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