bump termbox

This commit is contained in:
Jesse Duffield 2019-06-29 15:28:45 +10:00
parent 27eb5a6474
commit 31a6e59738
4 changed files with 7 additions and 2 deletions

4
Gopkg.lock generated
View file

@ -147,11 +147,11 @@
[[projects]]
branch = "master"
digest = "1:3ab130f65766f5b7cc944d557df31c6a007ec017151705ec1e1b8719f2689021"
digest = "1:e0306e92cef41d02af05a9f88395ec49c94f0255d54ca88ee3c02ae8f5806ee3"
name = "github.com/jesseduffield/termbox-go"
packages = ["."]
pruneopts = "NUT"
revision = "1e272ff78dcb4c448870f464fda1cdcf2bf0b3dd"
revision = "a9796224c07f5d757b399082bfee60de9574a2d9"
[[projects]]
branch = "v2"

View file

@ -120,6 +120,7 @@ func Interrupt() {
// when termbox's functionality isn't required anymore.
func Close() {
quit <- 1
quitPolling <- 1
out.WriteString(funcs[t_show_cursor])
out.WriteString(funcs[t_sgr0])
out.WriteString(funcs[t_clear_screen])
@ -382,6 +383,8 @@ func PollEvent() Event {
event.Type = EventResize
event.Width, event.Height = get_term_size(out.Fd())
return event
case <-quitPolling:
return Event{Type: EventStop}
}
}
}

View file

@ -184,4 +184,5 @@ const (
EventInterrupt
EventRaw
EventNone
EventStop
)

View file

@ -77,6 +77,7 @@ var (
sigwinch = make(chan os.Signal, 1)
sigio = make(chan os.Signal, 1)
quit = make(chan int)
quitPolling = make(chan int)
input_comm = make(chan input_event)
interrupt_comm = make(chan struct{})
intbuf = make([]byte, 0, 16)