Documentation
¶
Overview ¶
Package vminput provides direct virtual-machine input injection helpers.
It is intended to wrap the private keyboard, pointer, scroll, and multitouch event sender APIs exposed by VZVirtualMachine so callers can inject input without depending on AppKit focus or CGEvent delivery through the host window server.
The package should expose a small set of helpers for:
Keyboard events and text input Pointer movement, button events, and scrolling Multitouch and gesture delivery
All VM operations should run on the caller-supplied vm.Queue so the API remains safe to use from arbitrary goroutines.
Index ¶
- Variables
- type Sender
- func (s *Sender) Ready() bool
- func (s *Sender) SendDigitizerEvents(events unsafe.Pointer, deviceIndex uint32) error
- func (s *Sender) SendKeyboardEvents(events unsafe.Pointer, keyboardID uint32) error
- func (s *Sender) SendMagnifyEvents(events unsafe.Pointer, deviceIndex uint32) error
- func (s *Sender) SendMouseEvents(events unsafe.Pointer, deviceIndex uint32) error
- func (s *Sender) SendMultiTouchEvents(events unsafe.Pointer, deviceIndex uint32) error
- func (s *Sender) SendPointerNSEvent(event objectivec.IObject, deviceIndex uint32) error
- func (s *Sender) SendQuickLookEvents(events unsafe.Pointer, deviceIndex uint32) error
- func (s *Sender) SendRotationEvents(events unsafe.Pointer, deviceIndex uint32) error
- func (s *Sender) SendScrollWheelEvents(events unsafe.Pointer, deviceIndex uint32) error
- func (s *Sender) SendSmartMagnifyEvents(events unsafe.Pointer, deviceIndex uint32) error
- func (s *Sender) SendText(text string) error
- func (s *Sender) WaitReady(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrVMNotRunning reports that the VM is not running. ErrVMNotRunning = errors.New("vm not running") // ErrNotReady reports that the VM is not accepting HID reports. ErrNotReady = errors.New("vm not accepting hid reports") )
Functions ¶
This section is empty.
Types ¶
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender sends direct input events to a VM.
func NewSender ¶
func NewSender(queue *vm.Queue, vm vz.VZVirtualMachine) *Sender
NewSender creates a direct input sender for a VM.
func (*Sender) SendDigitizerEvents ¶
SendDigitizerEvents sends digitizer events to the VM.
func (*Sender) SendKeyboardEvents ¶
SendKeyboardEvents sends keyboard event objects to the VM.
func (*Sender) SendMagnifyEvents ¶
SendMagnifyEvents sends magnify events to the VM.
func (*Sender) SendMouseEvents ¶
SendMouseEvents sends mouse event objects to the VM.
func (*Sender) SendMultiTouchEvents ¶
SendMultiTouchEvents sends multitouch events to the VM.
func (*Sender) SendPointerNSEvent ¶
func (s *Sender) SendPointerNSEvent(event objectivec.IObject, deviceIndex uint32) error
SendPointerNSEvent forwards a single NSEvent to the VM.
func (*Sender) SendQuickLookEvents ¶
SendQuickLookEvents sends Quick Look events to the VM.
func (*Sender) SendRotationEvents ¶
SendRotationEvents sends rotation events to the VM.
func (*Sender) SendScrollWheelEvents ¶
SendScrollWheelEvents sends scroll wheel events to the VM.
func (*Sender) SendSmartMagnifyEvents ¶
SendSmartMagnifyEvents sends smart magnify events to the VM.