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{})
| 97 | // onKeyboard is called when char or key events are received. |
| 98 | // The events are dispatched to the focused IDispatcher or to non-GUI. |
| 99 | func (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 |
nothing calls this directly
no test coverage detected