MCPcopy
hub / github.com/g3n/engine / onMouse

Method onMouse

gui/image_button.go:183–197  ·  view source on GitHub ↗

onMouseEvent process subscribed mouse events

(evname string, ev interface{})

Source from the content-addressed store, hash-verified

181
182// onMouseEvent process subscribed mouse events
183func (b *ImageButton) onMouse(evname string, ev interface{}) {
184
185 switch evname {
186 case OnMouseDown:
187 Manager().SetKeyFocus(b)
188 b.pressed = true
189 b.update()
190 b.Dispatch(OnClick, nil)
191 case OnMouseUp:
192 b.pressed = false
193 b.update()
194 default:
195 return
196 }
197}
198
199// onKey processes subscribed key events
200func (b *ImageButton) onKey(evname string, ev interface{}) {

Callers

nothing calls this directly

Calls 4

updateMethod · 0.95
ManagerFunction · 0.85
SetKeyFocusMethod · 0.80
DispatchMethod · 0.65

Tested by

no test coverage detected