controller

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package controller can simulate user interaction

User interaction is primarily keyboard and mouse input. Mouse input is primarily clicking elements. Keyboard input should also handle:

- Move focus when pressing `tab` - Submit a form when pressing `enter` in a form field

Assuming that the events are not cancelled, and forms pass validation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyboardController

type KeyboardController struct {
	Window html.Window
}

KeyboardController simulates the user typing a sequence of keys.

func (KeyboardController) SendKey

func (c KeyboardController) SendKey(k key.Key)

SendKey simulates the input of a single key.

Ignored if no Window is assigned.

func (KeyboardController) SendKeys

func (c KeyboardController) SendKeys(keys iter.Seq[key.Key])

SendKeys simulates the user typing a sequence of keys. The key package contains functionality to generate sequences of keys from an input string.

Ignored if no Window is assigned.

Jump to

Keyboard shortcuts

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