Clarifying SetInputCapture() in documentation.

This commit is contained in:
Oliver 2018-01-14 21:54:05 +01:00
parent 626453b2a6
commit 9608f5b3b5
1 changed files with 3 additions and 1 deletions

4
box.go
View File

@ -121,11 +121,13 @@ func (b *Box) InputHandler() func(event *tcell.EventKey, setFocus func(p Primiti
return b.wrapInputHandler(nil) return b.wrapInputHandler(nil)
} }
// SetInputCapture sets a function which captures key events before they are // SetInputCapture installs a function which captures key events before they are
// forwarded to the primitive's default key event handler. This function can // forwarded to the primitive's default key event handler. This function can
// then choose to forward that key event (or a different one) to the default // then choose to forward that key event (or a different one) to the default
// handler by returning it. If nil is returned, the default handler will not // handler by returning it. If nil is returned, the default handler will not
// be called. // be called.
//
// Providing a nil handler will remove a previously existing handler.
func (b *Box) SetInputCapture(capture func(event *tcell.EventKey) *tcell.EventKey) *Box { func (b *Box) SetInputCapture(capture func(event *tcell.EventKey) *tcell.EventKey) *Box {
b.inputCapture = capture b.inputCapture = capture
return b return b