Documentation
¶
Overview ¶
Package input implements the cross-platform physical (synthetic) mouse/keyboard input layer of the Pando Desktop Controller. It is the PhysicalInput fallback the core.ActionResolver uses when a backend cannot perform an action natively (see internal/uiauto/core/action.go).
Each platform-specific file (input_windows.go, input_linux.go, input_darwin.go, input_other.go) provides its own New() (core.PhysicalInput, error) factory and CapabilitiesProbe() function, selected at compile time by //go:build tags. No file in this package uses cgo.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Capabilities ¶
func Capabilities() core.Capabilities
Capabilities probes what this platform's physical input implementation can actually do in the current session.
func NamedKeys ¶
func NamedKeys() []string
NamedKeys returns the set of canonical named-key identifiers (excluding single printable characters), sorted is not guaranteed.
func New ¶
func New() (core.PhysicalInput, error)
New constructs the Linux PhysicalInput implementation appropriate for the current session (X11 XTEST, or the Wayland RemoteDesktop portal). It never fails to construct; per-session unavailability surfaces as PLATFORM_NOT_SUPPORTED/PERM_DENIED from individual method calls, so a Manager can always be built and simply report reduced Capabilities.
Types ¶
type Chord ¶
Chord is a parsed key press request: zero or more modifiers plus a single canonical key name. Key is either one of the named keys in keyAliases (e.g. "enter", "f1", "pageup") or a single-rune printable character (lowercased letters keep their case-insensitivity; the caller is responsible for applying ModShift to get an uppercase letter or shifted symbol on platforms where that matters).
func ParseChord ¶
ParseChord parses a key/chord identifier such as "s", "Enter", "ctrl+s", or "cmd+alt+shift+x" into a Chord with canonicalized modifiers and key name. It is case-insensitive and tolerant of surrounding whitespace around "+"-separated parts. An empty string, a chord with no key component (e.g. "ctrl+"), or an unrecognized modifier returns an INVALID_ARGS *core.DesktopError.
func (Chord) HasModifier ¶
HasModifier reports whether m is present in the chord.
type Modifier ¶
type Modifier string
Modifier identifies a keyboard modifier used in a chord such as "ctrl+s".
const ( ModCtrl Modifier = "ctrl" ModAlt Modifier = "alt" // ModShift is the shift modifier. ModShift Modifier = "shift" // ModCmd is the platform "command" modifier: Cmd on macOS, Super/Win on // Linux/Windows. Accepts the aliases cmd/command/meta/win/windows/super // on input; always canonicalized to ModCmd. ModCmd Modifier = "cmd" )