From 3bf3645cd31c697a69667840675a058ab78288d5 Mon Sep 17 00:00:00 2001 From: Kevin Cotugno Date: Wed, 27 Dec 2017 15:47:43 -0800 Subject: [PATCH] Add `q` to application quit --- exhibit/event.go | 3 ++- spectator.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/exhibit/event.go b/exhibit/event.go index 23cdf37..e6ebc49 100644 --- a/exhibit/event.go +++ b/exhibit/event.go @@ -1,7 +1,8 @@ package exhibit const ( - CtrC = Event(3) + EventCtrC = Event(3) + Eventq = Event(113) ) type Event byte diff --git a/spectator.go b/spectator.go index 1cea7ad..b56f1be 100644 --- a/spectator.go +++ b/spectator.go @@ -105,7 +105,7 @@ func main() { go func() { for e := range terminal.Event { - if e == exhibit.CtrC { + if e == exhibit.EventCtrC || e == exhibit.Eventq { conn.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket. CloseNormalClosure, ""))