|
|
@ -51,28 +51,31 @@ func (ct *Cointop) ParseKeys(s string) (interface{}, tcell.ModMask) {
|
|
|
|
mod := tcell.ModNone
|
|
|
|
mod := tcell.ModNone
|
|
|
|
|
|
|
|
|
|
|
|
// translate legacy and special names for keys
|
|
|
|
// translate legacy and special names for keys
|
|
|
|
keyName := strings.TrimSpace(strings.Replace(s, "+", "-", -1))
|
|
|
|
s = strings.TrimSpace(s)
|
|
|
|
split := strings.Split(keyName, "-")
|
|
|
|
keyName := keyMap(s)
|
|
|
|
if len(split) > 1 {
|
|
|
|
if len(s) > 1 {
|
|
|
|
m := strings.ToLower(strings.TrimSpace(split[0]))
|
|
|
|
keyName := strings.Replace(s, "+", "-", -1)
|
|
|
|
k := strings.TrimSpace(split[1])
|
|
|
|
|
|
|
|
k = keyMap(k)
|
|
|
|
split := strings.Split(keyName, "-")
|
|
|
|
if k == " " {
|
|
|
|
if len(split) > 1 {
|
|
|
|
k = "Space" // fix mod+space
|
|
|
|
m := strings.ToLower(strings.TrimSpace(split[0]))
|
|
|
|
}
|
|
|
|
k := strings.TrimSpace(split[1])
|
|
|
|
|
|
|
|
k = keyMap(k)
|
|
|
|
|
|
|
|
if k == " " {
|
|
|
|
|
|
|
|
k = "Space" // fix mod+space
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if m == "alt" {
|
|
|
|
if m == "alt" {
|
|
|
|
mod = tcell.ModAlt
|
|
|
|
mod = tcell.ModAlt
|
|
|
|
keyName = k
|
|
|
|
keyName = k
|
|
|
|
} else if m == "ctrl" {
|
|
|
|
} else if m == "ctrl" {
|
|
|
|
// let the lookup handle it
|
|
|
|
// let the lookup handle it
|
|
|
|
keyName = m + "-" + k
|
|
|
|
keyName = m + "-" + k
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
keyName = m + "-" + k
|
|
|
|
keyName = m + "-" + k
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: other mods?
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// TODO: other mods?
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
keyName = keyMap(keyName)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// First try looking up keyname directly
|
|
|
|
// First try looking up keyname directly
|
|
|
|