SetKeyFocus sets the key-focused IDispatcher, which will exclusively receive key and char events.
(disp core.IDispatcher)
| 69 | |
| 70 | // SetKeyFocus sets the key-focused IDispatcher, which will exclusively receive key and char events. |
| 71 | func (gm *manager) SetKeyFocus(disp core.IDispatcher) { |
| 72 | |
| 73 | if gm.keyFocus == disp { |
| 74 | return |
| 75 | } |
| 76 | if gm.keyFocus != nil { |
| 77 | gm.keyFocus.Dispatch(OnFocusLost, nil) |
| 78 | } |
| 79 | gm.keyFocus = disp |
| 80 | if gm.keyFocus != nil { |
| 81 | gm.keyFocus.Dispatch(OnFocus, nil) |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | // SetCursorFocus sets the cursor-focused IDispatcher, which will exclusively receive OnCursor events. |
| 86 | func (gm *manager) SetCursorFocus(disp core.IDispatcher) { |
no test coverage detected