<commit_before>package venue

import (
	"image"
	"time"

	vnc "github.com/kward/go-vnc"
)

const (
	// Time to allow UI to settle.
	uiSettle = 10 * time.Millisecond
)

// KeyPress presses a key on the VENUE console.
func (v *Venue) KeyPress(key uint32) error {
	if err := v.conn.KeyEvent(key, true); err != nil {
		return err
	}
	time.Sleep(uiSettle)
	if err := v.conn.KeyEvent(key, false); err != nil {
		return err
	}
	time.Sleep(uiSettle)
	return nil
}

// MouseMove moves the mouse.
func (v *Venue) MouseMove(p image.Point) {
	v.conn.PointerEvent(vnc.ButtonNone, uint16(p.X), uint16(p.Y))
	time.Sleep(uiSettle)
}

// MouseLeftClick moves the mouse to a position and left clicks.
func (v *Venue) MouseLeftClick(p image.Point) {
	v.MouseMove(p)
	v.conn.PointerEvent(vnc.ButtonLeft, uint16(p.X), uint16(p.Y))
	time.Sleep(uiSettle)
	v.conn.PointerEvent(vnc.ButtonNone, uint16(p.X), uint16(p.Y))
	time.Sleep(uiSettle)
}

// MouseDrag moves the mouse, clicks, and drags to a new position.
func (v *Venue) MouseDrag(p, d image.Point) {
	v.MouseMove(p)
	v.conn.PointerEvent(vnc.ButtonLeft, uint16(p.X), uint16(p.Y))
	p = p.Add(d) // Add delta.
	v.conn.PointerEvent(vnc.ButtonLeft, uint16(p.X), uint16(p.Y))
	time.Sleep(uiSettle)
	v.conn.PointerEvent(vnc.ButtonNone, uint16(p.X), uint16(p.Y))
}<commit_msg>removed UI settling pauses as I moved them to go-vnc<commit_after>package venue

import (
	"image"

	vnc "github.com/kward/go-vnc"
)

// KeyPress presses a key on the VENUE console.
func (v *Venue) KeyPress(key uint32) error {
	if err := v.conn.KeyEvent(key, true); err != nil {
		return err
	}
	if err := v.conn.KeyEvent(key, false); err != nil {
		return err
	}
	return nil
}

// MouseMove moves the mouse.
func (v *Venue) MouseMove(p image.Point) {
	v.conn.PointerEvent(vnc.ButtonNone, uint16(p.X), uint16(p.Y))
}

// MouseLeftClick moves the mouse to a position and left clicks.
func (v *Venue) MouseLeftClick(p image.Point) {
	v.MouseMove(p)
	v.conn.PointerEvent(vnc.ButtonLeft, uint16(p.X), uint16(p.Y))
	v.conn.PointerEvent(vnc.ButtonNone, uint16(p.X), uint16(p.Y))
}

// MouseDrag moves the mouse, clicks, and drags to a new position.
func (v *Venue) MouseDrag(p, d image.Point) {
	v.MouseMove(p)
	v.conn.PointerEvent(vnc.ButtonLeft, uint16(p.X), uint16(p.Y))
	p = p.Add(d) // Add delta.
	v.conn.PointerEvent(vnc.ButtonLeft, uint16(p.X), uint16(p.Y))
	v.conn.PointerEvent(vnc.ButtonNone, uint16(p.X), uint16(p.Y))
}
{'fraction_non_alphanumeric': 0.15552805280528054, 'fraction_numerical': 0.022277227722772276, 'mean_word_length': 4.105263157894737, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '266756', 'n_tokens_mistral': 1034, 'n_tokens_neox': 986, 'n_words': 232}