Fix and rename PollEvents

This commit is contained in:
Caleb Bassi 2018-11-29 15:15:57 -08:00
parent df65ecda09
commit 27bbe8c0de
2 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,7 @@
## 18/11/29
- Move Tabpane from termui/extra to termui and rename it to TabPane
- Rename PollEvent to PollEvents
## 18/11/28

View File

@ -54,13 +54,13 @@ type Resize struct {
Height int
}
var pollingChannels [](chan Event)
// PollEvent gets events from termbox, converts them, then sends them to each of its channels.
func PollEvent() <-chan Event {
// PollEvents gets events from termbox, converts them, then sends them to each of its channels.
func PollEvents() <-chan Event {
ch := make(chan Event)
go func() {
ch <- convertTermboxEvent(tb.PollEvent())
for {
ch <- convertTermboxEvent(tb.PollEvent())
}
}()
return ch
}