MCPcopy Index your code
hub / github.com/g3n/engine / onKeyboard

Method onKeyboard

gui/manager.go:99–110  ·  view source on GitHub ↗

onKeyboard is called when char or key events are received. The events are dispatched to the focused IDispatcher or to non-GUI.

(evname string, ev interface{})

Source from the content-addressed store, hash-verified

97// onKeyboard is called when char or key events are received.
98// The events are dispatched to the focused IDispatcher or to non-GUI.
99func (gm *manager) onKeyboard(evname string, ev interface{}) {
100
101 if gm.keyFocus != nil {
102 if gm.modal == nil {
103 gm.keyFocus.Dispatch(evname, ev)
104 } else if ipan, ok := gm.keyFocus.(IPanel); ok && gm.modal.IsAncestorOf(ipan) {
105 gm.keyFocus.Dispatch(evname, ev)
106 }
107 } else {
108 gm.Dispatch(evname, ev)
109 }
110}
111
112// onMouse is called when mouse events are received.
113// OnMouseDown/OnMouseUp are dispatched to gm.target or to non-GUI, while

Callers

nothing calls this directly

Calls 2

DispatchMethod · 0.65
IsAncestorOfMethod · 0.65

Tested by

no test coverage detected