summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/gdamore/tcell/v2/simulation.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/gdamore/tcell/v2/simulation.go')
-rw-r--r--vendor/github.com/gdamore/tcell/v2/simulation.go22
1 files changed, 21 insertions, 1 deletions
diff --git a/vendor/github.com/gdamore/tcell/v2/simulation.go b/vendor/github.com/gdamore/tcell/v2/simulation.go
index 468aeebf7..451460be2 100644
--- a/vendor/github.com/gdamore/tcell/v2/simulation.go
+++ b/vendor/github.com/gdamore/tcell/v2/simulation.go
@@ -351,6 +351,26 @@ func (s *simscreen) Colors() int {
return 256
}
+func (s *simscreen) ChannelEvents(ch chan<- Event, quit <-chan struct{}) {
+ defer close(ch)
+ for {
+ select {
+ case <-quit:
+ return
+ case <-s.quit:
+ return
+ case ev := <-s.evch:
+ select {
+ case <-quit:
+ return
+ case <-s.quit:
+ return
+ case ch <- ev:
+ }
+ }
+ }
+}
+
func (s *simscreen) PollEvent() Event {
select {
case <-s.quit:
@@ -531,4 +551,4 @@ func (s *simscreen) Suspend() error {
func (s *simscreen) Resume() error {
return nil
-} \ No newline at end of file
+}