View definition

(AreaHandler).KeyEvent

Defined in github.com/andlabs/ui/areahandler.go

Description

KeyEvent is called when a key is pressed while the Area has keyboard focus (if the Area has been tabbed into or if the mouse has been clicked on it). See AreaKeyEvent for specifics.

Because some keyboard events are handled by the system (for instance, menu accelerators and global hotkeys), you must return whether you handled the key event; return true if you did or false if you did not. If you wish to ignore the keyboard outright, the correct implementation of KeyEvent is

func (h *MyHandler) KeyEvent(a *ui.Area, ke *ui.AreaKeyEvent) (handled bool) {
	return false
}

DO NOT RETURN TRUE UNCONDITIONALLY FROM THIS METHOD. BAD THINGS WILL HAPPEN IF YOU DO.

KeyEvent is referenced in 1 repository

github.com/andlabs/ui