Fix and rename PollEvents
This commit is contained in:
parent
df65ecda09
commit
27bbe8c0de
@ -1,6 +1,7 @@
|
|||||||
## 18/11/29
|
## 18/11/29
|
||||||
|
|
||||||
- Move Tabpane from termui/extra to termui and rename it to TabPane
|
- Move Tabpane from termui/extra to termui and rename it to TabPane
|
||||||
|
- Rename PollEvent to PollEvents
|
||||||
|
|
||||||
## 18/11/28
|
## 18/11/28
|
||||||
|
|
||||||
|
10
events.go
10
events.go
@ -54,13 +54,13 @@ type Resize struct {
|
|||||||
Height int
|
Height int
|
||||||
}
|
}
|
||||||
|
|
||||||
var pollingChannels [](chan Event)
|
// PollEvents gets events from termbox, converts them, then sends them to each of its channels.
|
||||||
|
func PollEvents() <-chan Event {
|
||||||
// PollEvent gets events from termbox, converts them, then sends them to each of its channels.
|
|
||||||
func PollEvent() <-chan Event {
|
|
||||||
ch := make(chan Event)
|
ch := make(chan Event)
|
||||||
go func() {
|
go func() {
|
||||||
ch <- convertTermboxEvent(tb.PollEvent())
|
for {
|
||||||
|
ch <- convertTermboxEvent(tb.PollEvent())
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
return ch
|
return ch
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user