From 892bebd6179ac00f8272a57f72f1cd63cccf771b Mon Sep 17 00:00:00 2001 From: SuperPaintman Date: Wed, 4 Nov 2020 02:55:15 +0300 Subject: [PATCH] Fix a mouse example --- examples/mouse/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/mouse/main.go b/examples/mouse/main.go index a21e45c..442051f 100644 --- a/examples/mouse/main.go +++ b/examples/mouse/main.go @@ -35,7 +35,7 @@ func (m model) Init() tea.Cmd { func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case tea.KeyMsg: - if msg.Type == tea.KeyCtrlC || (msg.Type == tea.KeyRune && msg.Rune == 'q') { + if s := msg.String(); s == "ctrl+c" || s == "q" { return m, tea.Quit }