func (l *TextDisplay) ProcessEvent(event Event) bool {
	if !l.Active() || !l.Enabled() {
		return false
	}

	switch event.Type {
	case EventKey:
		switch event.Key {
		case term.KeyHome:
			l.home()
			return true
		case term.KeyEnd:
			l.end()
			return true
		case term.KeyArrowUp:
			l.moveUp(1)
			return true
		case term.KeyArrowDown:
			l.moveDown(1)
			return true
		case term.KeyPgup:
			l.moveUp(l.height - 1)
			return true
		case term.KeyPgdn, term.KeySpace:
			l.moveDown(l.height - 1)
			return true
		}

		switch event.Ch {
		case 'k', 'K':
			l.moveUp(1)
			return true
		case 'j', 'J':
			l.moveDown(1)
			return true
		case 'u', 'U':
			l.moveUp(l.height - 1)
			return true
		case 'd', 'D':
			l.moveDown(l.height - 1)
			return true
		default:
			return false
		}
	case EventMouse:
		return l.processMouseClick(event)
	}

	return false
}
func (l *TextDisplay) ProcessEvent(event Event) bool {
	if !l.Active() || !l.Enabled() {
		return false
	}

	switch event.Type {
	case EventKey:
		switch event.Key {
		case term.KeyHome:
			l.home()
			return true
		case term.KeyEnd:
			l.end()
			return true
		case term.KeyArrowUp:
			l.moveUp(1)
			return true
		case term.KeyArrowDown:
			l.moveDown(1)
			return true
		case term.KeyPgup:
			l.moveUp(l.height - 1)
			return true
		case term.KeyPgdn, term.KeySpace:
			l.moveDown(l.height - 1)
			return true
		}

		switch event.Ch {
		case 'k', 'K':
			l.moveUp(1)
			return true
		case 'j', 'J':
			l.moveDown(1)
			return true
		case 'u', 'U':
			l.moveUp(l.height - 1)
			return true
		case 'd', 'D':
			l.moveDown(l.height - 1)
			return true
		default:
			return false
		}
	case EventMouse:
		return l.processMouseClick(event)
	}

	return false
}
func ( l * TextDisplay ) ProcessEvent ( event Event ) bool { if ! l . Active ( ) || ! l . Enabled ( ) { return false } switch event . Type { case EventKey : switch event . Key { case term . KeyHome : l . home ( ) return true case term . KeyEnd : l . end ( ) return true case term . KeyArrowUp : l . moveUp ( 1 ) return true case term . KeyArrowDown : l . moveDown ( 1 ) return true case term . KeyPgup : l . moveUp ( l . height - 1 ) return true case term . KeyPgdn , term . KeySpace : l . moveDown ( l . height - 1 ) return true } switch event . Ch { case 'k' , 'K' : l . moveUp ( 1 ) return true case 'j' , 'J' : l . moveDown ( 1 ) return true case 'u' , 'U' : l . moveUp ( l . height - 1 ) return true case 'd' , 'D' : l . moveDown ( l . height - 1 ) return true default : return false } case EventMouse : return l . processMouseClick ( event ) } return false }
/*
ProcessEvent processes all events come from the control parent. If a control
processes an event it should return true. If the method returns false it means
that the control do not want or cannot process the event and the caller sends
the event to the control parent
*/
/ * ProcessEvent processes all events come from the control parent . If a control processes an event it should return true . If the method returns false it means that the control do not want or cannot process the event and the caller sends the event to the control parent