mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
Fix a bug where control keys weren't being properly mapped
This commit is contained in:
4
key.go
4
key.go
@@ -46,7 +46,7 @@ const (
|
||||
KeyLeft
|
||||
KeyUnitSeparator
|
||||
KeyBackspace
|
||||
KeyRune
|
||||
KeyRune = -1
|
||||
)
|
||||
|
||||
// Friendly key names
|
||||
@@ -111,7 +111,7 @@ func ReadKey(r io.Reader) (Key, error) {
|
||||
|
||||
// Is it a control character?
|
||||
if n == 1 && c <= keyUS || c == keyDEL {
|
||||
if k, ok := controlKeys[n]; ok {
|
||||
if k, ok := controlKeys[int(c)]; ok {
|
||||
return Key{Type: k}, nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user