MCPcopy Create free account
hub / github.com/cogentcore/core / Touch

Method Touch

events/source.go:150–162  ·  view source on GitHub ↗

Touch creates and sends a touch event with the given values. It also creates and sends a corresponding mouse event.

(typ Types, seq Sequence, where image.Point)

Source from the content-addressed store, hash-verified

148// Touch creates and sends a touch event with the given values.
149// It also creates and sends a corresponding mouse event.
150func (es *Source) Touch(typ Types, seq Sequence, where image.Point) {
151 ev := NewTouch(typ, seq, where)
152 ev.Init()
153 es.Deque.Send(ev)
154
155 if typ == TouchStart {
156 es.MouseButton(MouseDown, Left, where, 0) // TODO: modifiers
157 } else if typ == TouchEnd {
158 es.MouseButton(MouseUp, Left, where, 0) // TODO: modifiers
159 } else {
160 es.MouseMove(where)
161 }
162}
163
164// Magnify creates and sends a [TouchMagnify] event with the given values.
165func (es *Source) Magnify(scaleFactor float32, where image.Point) {

Callers 2

ProcessEventFunction · 0.80
sendTouchFunction · 0.80

Calls 5

MouseButtonMethod · 0.95
MouseMoveMethod · 0.95
NewTouchFunction · 0.85
InitMethod · 0.65
SendMethod · 0.45

Tested by

no test coverage detected