Documentation
¶
Overview ¶
Package magnify resolves semantic zoom and pinch requests into concrete backend actions.
Index ¶
- Constants
- Variables
- type Action
- func ParsePinchDirection(value string) (Action, error)
- func ParseZoomAction(value string) (Action, error)
- func PinchElement(target *axuiautomation.Element, strategy Strategy, direction string) (Action, string, error)
- func ZoomElement(target *axuiautomation.Element, strategy Strategy, action string) (Action, string, error)
- type Shortcut
- type Strategy
Constants ¶
const ShortcutNote = "used the standard app zoom shortcut; public macOS APIs do not expose a generic cross-process magnify gesture injector"
ShortcutNote explains the current fallback used for semantic magnify.
Variables ¶
var ErrNativeUnsupported = errors.New("native magnify injection is not supported")
ErrNativeUnsupported reports that native magnify injection is not available.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action string
Action is a canonical semantic zoom or pinch direction.
func ParsePinchDirection ¶
ParsePinchDirection canonicalizes semantic pinch directions.
func ParseZoomAction ¶
ParseZoomAction canonicalizes semantic zoom actions.
func PinchElement ¶
func PinchElement(target *axuiautomation.Element, strategy Strategy, direction string) (Action, string, error)
PinchElement focuses target when provided, then applies a semantic pinch direction.
func ZoomElement ¶
func ZoomElement(target *axuiautomation.Element, strategy Strategy, action string) (Action, string, error)
ZoomElement focuses target when provided, then applies a semantic zoom action.
type Shortcut ¶
Shortcut identifies the standard app zoom shortcut for a semantic action.
func Dispatch ¶
func Dispatch(strategy Strategy, action Action, sendKeys func(string) error) (Shortcut, string, error)
Dispatch applies action using strategy and the provided key sender.
func ShortcutForAction ¶
ShortcutForAction returns the standard app zoom shortcut for action.
type Strategy ¶
type Strategy string
Strategy selects how a semantic magnify request is executed.
func ParseStrategy ¶
ParseStrategy parses a magnify backend strategy. The zero value and empty input select the shortcut strategy.