MCPcopy Create free account
hub / github.com/SolarLune/masterplan / makeMouseAction

Method makeMouseAction

contents.go:5648–5674  ·  view source on GitHub ↗
(x, y float64, inputType input.MouseType, opts ...chromedp.MouseOption)

Source from the content-addressed store, hash-verified

5646}
5647
5648func (w *InternetContents) makeMouseAction(x, y float64, inputType input.MouseType, opts ...chromedp.MouseOption) chromedp.ActionFunc {
5649
5650 return chromedp.ActionFunc(func(ctx context.Context) error {
5651 p := &input.DispatchMouseEventParams{
5652 Type: inputType,
5653 X: x,
5654 Y: y,
5655 Button: input.Left,
5656 ClickCount: 1,
5657 }
5658
5659 // apply opts
5660 for _, o := range opts {
5661 p = o(p)
5662 }
5663
5664 if err := p.Do(ctx); err != nil {
5665 return err
5666 }
5667
5668 return nil
5669
5670 // p.Type = input.MouseReleased
5671 // return p.Do(ctx)
5672 })
5673
5674}
5675
5676func (w *InternetContents) ToggleRecordInput() {
5677 w.RecordInput = !w.RecordInput

Callers 1

UpdateMethod · 0.95

Calls 1

DoMethod · 0.80

Tested by

no test coverage detected