Fix a mouse example

This commit is contained in:
SuperPaintman 2020-11-04 02:55:15 +03:00 committed by Christian Rocha
parent 116a0cfb8f
commit 892bebd617
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ func (m model) Init() tea.Cmd {
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) { switch msg := msg.(type) {
case tea.KeyMsg: 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 return m, tea.Quit
} }