mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
keys: properly support the alt modifier
This commit is contained in:
committed by
Christian Muehlhaeuser
parent
f905b97756
commit
134a930f2d
18
key_test.go
18
key_test.go
@@ -134,6 +134,24 @@ func TestReadInput(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
"alt+enter": {
|
||||
[]byte{'\x1b', '\r'},
|
||||
[]Msg{
|
||||
KeyMsg{
|
||||
Type: KeyEnter,
|
||||
Alt: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
"alt+ctrl+a": {
|
||||
[]byte{'\x1b', byte(keySOH)},
|
||||
[]Msg{
|
||||
KeyMsg{
|
||||
Type: KeyCtrlA,
|
||||
Alt: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
} {
|
||||
t.Run(out, func(t *testing.T) {
|
||||
msgs, err := readInputs(bytes.NewReader(td.in))
|
||||
|
||||
Reference in New Issue
Block a user