input

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyboardModifierNone  KeyboardModifier = 0
	KeyboardModifierAlt   KeyboardModifier = 1
	KeyboardModifierCtrl  KeyboardModifier = 2
	KeyboardModifierCmd   KeyboardModifier = 4
	KeyboardModifierShift KeyboardModifier = 8

	// 1=Left, 2=Right
	KeyboardLocationNone  KeyboardLocation = 0
	KeyboardLocationLeft  KeyboardLocation = 1
	KeyboardLocationRight KeyboardLocation = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Keyboard

type Keyboard struct {
	// contains filtered or unexported fields
}

func NewKeyboard

func NewKeyboard(client *cdp.Client) *Keyboard

func (*Keyboard) Down

func (k *Keyboard) Down(ctx context.Context, char string) error

func (*Keyboard) Press added in v0.9.0

func (k *Keyboard) Press(ctx context.Context, keys []string, count int, delay time.Duration) error

func (*Keyboard) Type

func (k *Keyboard) Type(ctx context.Context, text string, delay time.Duration) error

func (*Keyboard) Up

func (k *Keyboard) Up(ctx context.Context, char string) error

type KeyboardKey added in v0.9.0

type KeyboardKey struct {
	KeyCode  int
	Key      string
	Code     string
	Modifier KeyboardModifier
	Location KeyboardLocation
}

type KeyboardLocation added in v0.9.0

type KeyboardLocation int

type KeyboardModifier added in v0.9.0

type KeyboardModifier int

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func New added in v0.16.0

func New(
	logger zerolog.Logger,
	client *cdp.Client,
	exec *eval.Runtime,
	keyboard *Keyboard,
	mouse *Mouse,
) *Manager

func (*Manager) Blur added in v0.9.0

func (m *Manager) Blur(ctx context.Context, objectID runtime.RemoteObjectID) error

func (*Manager) BlurBySelector added in v0.9.0

func (m *Manager) BlurBySelector(ctx context.Context, id runtime.RemoteObjectID, selector drivers.QuerySelector) error

func (*Manager) Clear added in v0.9.0

func (m *Manager) Clear(ctx context.Context, objectID runtime.RemoteObjectID) error

func (*Manager) ClearBySelector added in v0.9.0

func (m *Manager) ClearBySelector(ctx context.Context, id runtime.RemoteObjectID, selector drivers.QuerySelector) error

func (*Manager) ClearByXY added in v0.9.0

func (m *Manager) ClearByXY(ctx context.Context, points Quad) error

func (*Manager) Click

func (m *Manager) Click(ctx context.Context, objectID runtime.RemoteObjectID, count int) error

func (*Manager) ClickBySelector

func (m *Manager) ClickBySelector(ctx context.Context, id runtime.RemoteObjectID, selector drivers.QuerySelector, count values.Int) error

func (*Manager) Focus

func (m *Manager) Focus(ctx context.Context, objectID runtime.RemoteObjectID) error

func (*Manager) FocusBySelector

func (m *Manager) FocusBySelector(ctx context.Context, id runtime.RemoteObjectID, selector drivers.QuerySelector) error

func (*Manager) Keyboard

func (m *Manager) Keyboard() *Keyboard

func (*Manager) Mouse

func (m *Manager) Mouse() *Mouse

func (*Manager) MoveMouse

func (m *Manager) MoveMouse(ctx context.Context, objectID runtime.RemoteObjectID) error

func (*Manager) MoveMouseBySelector

func (m *Manager) MoveMouseBySelector(ctx context.Context, id runtime.RemoteObjectID, selector drivers.QuerySelector) error

func (*Manager) MoveMouseByXY

func (m *Manager) MoveMouseByXY(ctx context.Context, xv, yv values.Float) error

func (*Manager) Press added in v0.15.0

func (m *Manager) Press(ctx context.Context, keys []string, count int) error

func (*Manager) PressBySelector added in v0.15.0

func (m *Manager) PressBySelector(ctx context.Context, id runtime.RemoteObjectID, selector drivers.QuerySelector, keys []string, count int) error

func (*Manager) ScrollBottom

func (m *Manager) ScrollBottom(ctx context.Context, options drivers.ScrollOptions) error

func (*Manager) ScrollByXY

func (m *Manager) ScrollByXY(ctx context.Context, options drivers.ScrollOptions) error

func (*Manager) ScrollIntoView

func (m *Manager) ScrollIntoView(ctx context.Context, id runtime.RemoteObjectID, options drivers.ScrollOptions) error

func (*Manager) ScrollIntoViewBySelector

func (m *Manager) ScrollIntoViewBySelector(ctx context.Context, id runtime.RemoteObjectID, selector drivers.QuerySelector, options drivers.ScrollOptions) error

func (*Manager) ScrollTop

func (m *Manager) ScrollTop(ctx context.Context, options drivers.ScrollOptions) error

func (*Manager) Select

func (m *Manager) Select(ctx context.Context, id runtime.RemoteObjectID, value *values.Array) (*values.Array, error)

func (*Manager) SelectBySelector

func (m *Manager) SelectBySelector(ctx context.Context, id runtime.RemoteObjectID, selector drivers.QuerySelector, value *values.Array) (*values.Array, error)

func (*Manager) Type

func (m *Manager) Type(ctx context.Context, objectID runtime.RemoteObjectID, params TypeParams) error

func (*Manager) TypeBySelector

func (m *Manager) TypeBySelector(ctx context.Context, id runtime.RemoteObjectID, selector drivers.QuerySelector, params TypeParams) error

type Mouse

type Mouse struct {
	// contains filtered or unexported fields
}

func NewMouse

func NewMouse(client *cdp.Client) *Mouse

func (*Mouse) Click

func (m *Mouse) Click(ctx context.Context, x, y float64, delay time.Duration) error

func (*Mouse) ClickWithCount added in v0.9.0

func (m *Mouse) ClickWithCount(ctx context.Context, x, y float64, delay time.Duration, count int) error

func (*Mouse) Down

func (m *Mouse) Down(ctx context.Context, button input.MouseButton) error

func (*Mouse) DownWithCount added in v0.9.0

func (m *Mouse) DownWithCount(ctx context.Context, button input.MouseButton, count int) error

func (*Mouse) Move

func (m *Mouse) Move(ctx context.Context, x, y float64) error

func (*Mouse) MoveBySteps

func (m *Mouse) MoveBySteps(ctx context.Context, x, y float64, steps int) error

func (*Mouse) Up

func (m *Mouse) Up(ctx context.Context, button input.MouseButton) error

func (*Mouse) UpWithCount added in v0.9.0

func (m *Mouse) UpWithCount(ctx context.Context, button input.MouseButton, count int) error

type Quad

type Quad struct {
	X float64
	Y float64
}

func GetClickablePointByObjectID

func GetClickablePointByObjectID(ctx context.Context, client *cdp.Client, objectID runtime.RemoteObjectID) (Quad, error)

type TypeParams added in v0.9.0

type TypeParams struct {
	Text  string
	Clear bool
	Delay time.Duration
}

Jump to

Keyboard shortcuts

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