PowerKeys Scripting API
    Preparing search index...

    Interface UIOverlayOptions

    Detached overlay or utility-window options. Geometry is expressed as integer physical pixels in the Windows virtual-desktop coordinate space, matching Screen, Mouse, and Window. The x/y origin can be negative on monitors left of or above the primary monitor. Window geometry describes the rendered client/content area, not the invisible native frame or shadow. Cross-monitor moves reapply the requested physical content size after Windows processes its DPI transition, so no caller-side DPI scaling is needed. Options passed to SetWindowOptions or Show are partial updates; changing mode resets unspecified mutable fields to that mode's defaults. Native webview transparency is create-only and is preserved across later mode changes.

    interface UIOverlayOptions {
        mode?: "hud" | "window";
        title?: string;
        chrome?: "none" | "system" | "custom";
        draggable?: boolean;
        dragModifier?: string;
        resizable?: boolean;
        minWidth?: number;
        minHeight?: number;
        maxWidth?: number;
        maxHeight?: number;
        alwaysOnTop?: boolean;
        skipTaskbar?: boolean;
        clickThrough?: boolean;
        focusable?: boolean;
        noActivate?: boolean;
        opacity?: number;
        contentProtected?: boolean;
        transparent?: boolean;
        width?: number;
        height?: number;
        x?: number;
        y?: number;
        anchor?:
            | "top-left"
            | "top-center"
            | "top-right"
            | "left-center"
            | "center"
            | "right-center"
            | "bottom-left"
            | "bottom-center"
            | "bottom-right";
        offsetX?: number;
        offsetY?: number;
        targetWindowId?: string
        | null;
        style?: UIStyle;
    }
    Index
    mode?: "hud" | "window"

    Overlay behavior preset. Defaults to hud. At creation, hud is strictly display-only and defaults to transparent, click-through, non-focusable, no-activate, always-on-top, and hidden from the taskbar. window permits interactive controls and initially defaults to an opaque, focusable, resizable utility window. Later mode changes reset mutable fields but preserve the create-time transparent value.

    title?: string

    Native window title. Defaults to PowerKeys Overlay for hud and PowerKeys for window.

    chrome?: "none" | "system" | "custom"

    Native window chrome. Defaults to none for hud and custom for window; system uses the operating-system title bar and borders.

    draggable?: boolean

    Whether the rendered overlay can be dragged. Defaults to false for hud and true for window. Enabling this on a hud also disables clickThrough unless clickThrough is explicitly supplied.

    dragModifier?: string

    Optional modifier key required before dragging starts. Accepted case-insensitively: Ctrl/Control, Shift, Alt/Menu, Win/Meta/Super, or a left/right-specific form such as LCtrl, LeftControl, RShift, RightAlt, LWin, or RightSuper. Spaces, hyphens, and underscores are ignored. An invalid non-empty name throws when options are applied; an empty string clears the modifier.

    resizable?: boolean

    Whether the native window can be resized by the user. Defaults to false for hud and true for window.

    minWidth?: number

    Minimum rendered-content width in positive integer physical pixels. Applied only when minHeight is also set. Once set, it remains until replaced or a mode change resets the options; null is invalid and does not clear it.

    minHeight?: number

    Minimum rendered-content height in positive integer physical pixels. Applied only when minWidth is also set. Once set, it remains until replaced or a mode change resets the options; null is invalid and does not clear it.

    maxWidth?: number

    Maximum rendered-content width in positive integer physical pixels. Applied only when maxHeight is also set. Once set, it remains until replaced or a mode change resets the options; null is invalid and does not clear it.

    maxHeight?: number

    Maximum rendered-content height in positive integer physical pixels. Applied only when maxWidth is also set. Once set, it remains until replaced or a mode change resets the options; null is invalid and does not clear it.

    alwaysOnTop?: boolean

    Whether the overlay stays above other windows. Defaults to true for hud and false for window.

    skipTaskbar?: boolean

    Whether the overlay is hidden from the taskbar. Defaults to true for hud and false for window.

    clickThrough?: boolean

    Whether pointer input passes through to windows underneath. Defaults to true for hud and false for window.

    focusable?: boolean

    Whether the overlay can receive keyboard focus. Defaults to false for hud and true for window.

    noActivate?: boolean

    Whether Show avoids activating or stealing focus from the current foreground window. Defaults to true for hud and false for window.

    opacity?: number

    Whole-window opacity. Finite values are clamped to the inclusive 0..1 range; defaults to 1.

    contentProtected?: boolean

    Whether the overlay content should be hidden from screen capture when the platform supports it. Defaults to false.

    transparent?: boolean

    Whether the native webview background supports transparency. This is applied only by CreateOverlay, defaulting to true for hud and false for window. Later Show or SetWindowOptions calls may repeat the existing value, but attempting to change it throws; mode changes preserve it.

    width?: number

    Rendered client/content width in positive integer physical pixels. Defaults to 320 for hud and 360 for window.

    height?: number

    Rendered client/content height in positive integer physical pixels. Defaults to 160 for hud and 240 for window.

    x?: number

    Absolute x coordinate of the rendered content's top-left edge in virtual-desktop physical pixels. When supplied, x overrides anchor and offsetX on that axis and remains until replaced or a mode change resets the options; null is invalid and does not restore anchor placement.

    y?: number

    Absolute y coordinate of the rendered content's top-left edge in virtual-desktop physical pixels. When supplied, y overrides anchor and offsetY on that axis and remains until replaced or a mode change resets the options; null is invalid and does not restore anchor placement.

    anchor?:
        | "top-left"
        | "top-center"
        | "top-right"
        | "left-center"
        | "center"
        | "right-center"
        | "bottom-left"
        | "bottom-center"
        | "bottom-right"

    Anchor within targetWindowId's outer physical bounds, or within the complete virtual desktop when no target is set. Half-pixel anchor results round to the nearest physical pixel. Defaults to top-left; invalid strings are rejected.

    offsetX?: number

    Signed integer physical-pixel offset from the resolved anchor on x. Used only when x is omitted; defaults to 0.

    offsetY?: number

    Signed integer physical-pixel offset from the resolved anchor on y. Used only when y is omitted; defaults to 0.

    targetWindowId?: string | null

    Optional WindowInfo.id whose outer native bounds are followed every 250 ms once detected. A target assigned after creation is detected within about one second. Anchor placement is recomputed as the target moves or resizes. If the id cannot be resolved, the overlay stays hidden instead of falling back to the virtual desktop; the target tracker then clears this field and OnTargetLost fires once. An empty string clears the target; null is treated as omitted and does not clear it.

    style?: UIStyle

    CSS-like style for the rendered overlay root. CreateOverlay sets this initial style and SetWindowOptions replaces the whole style map; SetStyle merges instead. Renderer/CSS values use CSS logical pixels and are intentionally separate from native physical-pixel window geometry.