Bind a shift+key version if key char is uppercase

pull/232/head
ѵµσɳɠ 3 years ago
parent ebb7ffeaa4
commit e872d44a70
No known key found for this signature in database
GPG Key ID: 9E32EEF440B0A5D4

@ -305,7 +305,7 @@ func CurrencySymbol(currency string) string {
return "?"
}
// StatusbarMouseLeftClick is called on mouse left click event
// ConversionMouseLeftClick is called on mouse left click event
func (ct *Cointop) ConversionMouseLeftClick() error {
v, x, y, err := ct.g.GetViewRelativeMousePosition(ct.g.CurrentEvent)
if err != nil {

@ -2,6 +2,7 @@ package cointop
import (
"strings"
"unicode"
"github.com/cointop-sh/cointop/pkg/gocui"
"github.com/gdamore/tcell/v2"
@ -89,6 +90,7 @@ func (ct *Cointop) ParseKeys(s string) (interface{}, tcell.ModMask) {
if len(keyName) == 1 {
r := []rune(keyName)
key = r[0]
return key, mod
}
@ -267,6 +269,13 @@ func (ct *Cointop) SetKeybindingAction(shortcutKey string, action string) error
}
ct.SetKeybindingMod(key, mod, fn, view)
// Bind `shift+key` for uppercased character
r, isRune := key.(rune)
if isRune && unicode.IsUpper(r) {
ct.SetKeybindingMod(key, tcell.ModShift, fn, view)
}
return nil
}

Loading…
Cancel
Save