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)
| 148 | // Touch creates and sends a touch event with the given values. |
| 149 | // It also creates and sends a corresponding mouse event. |
| 150 | func (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. |
| 165 | func (es *Source) Magnify(scaleFactor float32, where image.Point) { |
no test coverage detected