win32

package
v4.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2026 License: LGPL-3.0 Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package win32 defines the screencap and input method flags for Win32 controllers, with name parsing helpers.

Index

Constants

View Source
const (
	// ScreencapNone selects no Win32 screencap method.
	ScreencapNone ScreencapMethod = 0
	// ScreencapGDI selects the GDI method: fast, medium compatibility.
	ScreencapGDI ScreencapMethod = 1
	// ScreencapFramePool selects the FramePool method: very fast, medium
	// compatibility. Requires Windows 10 1903+ and supports background
	// capture and pseudo-minimize.
	ScreencapFramePool ScreencapMethod = 1 << 1
	// ScreencapDXGIDesktopDup selects the DXGI_DesktopDup method: very
	// fast, low compatibility. Desktop duplication (full screen).
	ScreencapDXGIDesktopDup ScreencapMethod = 1 << 2
	// ScreencapDXGIDesktopDupWindow selects the DXGI_DesktopDup_Window
	// method: very fast, low compatibility. Desktop duplication then crop.
	ScreencapDXGIDesktopDupWindow ScreencapMethod = 1 << 3
	// ScreencapPrintWindow selects the PrintWindow method: medium speed,
	// medium compatibility. Supports background capture and
	// pseudo-minimize.
	ScreencapPrintWindow ScreencapMethod = 1 << 4
	// ScreencapScreenDC selects the ScreenDC method: fast, high
	// compatibility.
	ScreencapScreenDC ScreencapMethod = 1 << 5

	// ScreencapAll selects every Win32 screencap method.
	ScreencapAll ScreencapMethod = ^ScreencapNone
	// ScreencapForeground selects the predefined foreground combination:
	// DXGI_DesktopDup_Window | ScreenDC.
	ScreencapForeground ScreencapMethod = ScreencapDXGIDesktopDupWindow | ScreencapScreenDC
	// ScreencapBackground selects the predefined background combination:
	// FramePool | PrintWindow.
	ScreencapBackground ScreencapMethod = ScreencapFramePool | ScreencapPrintWindow

	// InputNone selects no Win32 input method.
	InputNone InputMethod = 0
	// InputSeize selects the Seize input method.
	InputSeize InputMethod = 1
	// InputSendMessage selects the SendMessage input method: medium
	// compatibility, supports background input.
	InputSendMessage InputMethod = 1 << 1
	// InputPostMessage selects the PostMessage input method: medium
	// compatibility, supports background input.
	InputPostMessage InputMethod = 1 << 2
	// InputLegacyEvent selects the LegacyEvent input method: low
	// compatibility, seizes the mouse, no background support.
	InputLegacyEvent InputMethod = 1 << 3
	// InputPostThreadMessage selects the PostThreadMessage input method.
	//
	// Deprecated: upstream deprecated this method and no longer implements
	// it. A controller created with it still connects, but every input
	// action fails.
	InputPostThreadMessage InputMethod = 1 << 4
	// InputSendMessageWithCursorPos selects the SendMessageWithCursorPos
	// input method: medium compatibility, supports background input.
	// Briefly moves the cursor to the target position, then restores it.
	InputSendMessageWithCursorPos InputMethod = 1 << 5
	// InputPostMessageWithCursorPos selects the PostMessageWithCursorPos
	// input method: medium compatibility, supports background input.
	// Briefly moves the cursor to the target position, then restores it.
	InputPostMessageWithCursorPos InputMethod = 1 << 6
	// InputSendMessageWithWindowPos selects the SendMessageWithWindowPos
	// input method: medium compatibility, supports background input.
	// Briefly moves the window to align the target with the cursor, then
	// restores it; the cursor is not moved.
	InputSendMessageWithWindowPos InputMethod = 1 << 7
	// InputPostMessageWithWindowPos selects the PostMessageWithWindowPos
	// input method: medium compatibility, supports background input.
	// Briefly moves the window to align the target with the cursor, then
	// restores it; the cursor is not moved.
	InputPostMessageWithWindowPos InputMethod = 1 << 8
	// InputInterception selects the Interception input method:
	// driver-level input injection via the Interception driver.
	InputInterception InputMethod = 1 << 9
	// InputAnchoredTouch injects touch points without moving the cursor or target window.
	// It supports clicks and swipes, but not scrolling or keyboard input.
	InputAnchoredTouch InputMethod = 1 << 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type InputMethod

type InputMethod uint64

InputMethod defines the Win32 input method.

Select ONE method only; do not combine with bitwise OR.

func ParseInputMethod

func ParseInputMethod(s string) (InputMethod, error)

ParseInputMethod parses an input method name, matched case-insensitively with surrounding whitespace ignored. Unrecognized names fall back to a decimal numeric value; input matching neither returns an error.

func (InputMethod) String

func (m InputMethod) String() string

String returns the input method's canonical name, or its decimal value for unnamed combinations.

type ScreencapMethod

type ScreencapMethod uint64

ScreencapMethod defines the Win32 screencap method flags.

Use bitwise OR to combine methods; MaaFramework tests them and uses the fastest available one.

func ParseScreencapMethod

func ParseScreencapMethod(s string) (ScreencapMethod, error)

ParseScreencapMethod parses a screencap method name, matched case-insensitively with surrounding whitespace ignored. It accepts both the canonical upstream spellings and this binding's legacy underscore-free DXGI spellings ("DXGIDesktopDup", "DXGIDesktopDupWindow"). Unrecognized names fall back to a decimal numeric value; input matching neither returns an error.

func (ScreencapMethod) String

func (m ScreencapMethod) String() string

String returns the screencap method's canonical upstream spelling (for example "DXGI_DesktopDup_Window"), or its decimal value for unnamed combinations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL