Skip to content
Myr

Catch Ctrl+C

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Rocha · committed by Christian Rocha · parent d9cf7d1 · Browse files · 2 files+4 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+4 added−0 removed

  • other:+4 added−0 removed

2 files+4 added−0 removed

modified:example/main.go+2 added
38 unmodified lines
3940 case "q":41 fallthrough42 case "esc":43 fallthrough44 case "ctrl+c":45 return m, tea.Quit4647 }48 }
28 unmodified lines
modified:key.go+2 added
9 unmodified lines
10type KeyPressMsg string1112// Control keys13const (14 keyETX = 3 // ctrl+c15 keyESC = 2716 keyUS = 3117)1819var controlKeyNames = map[int]string{20 keyETX: "ctrl+c",21 keyESC: "esc",22 keyUS: "us",23}24
39 unmodified lines