mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
io/key: [API] replace key.InputOp with a filter
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-3
@@ -752,8 +752,8 @@ func osMain() {
|
||||
select {}
|
||||
}
|
||||
|
||||
func translateKey(k string) (string, bool) {
|
||||
var n string
|
||||
func translateKey(k string) (key.Name, bool) {
|
||||
var n key.Name
|
||||
|
||||
switch k {
|
||||
case "ArrowUp":
|
||||
@@ -820,7 +820,7 @@ func translateKey(k string) (string, bool) {
|
||||
r, s := utf8.DecodeRuneInString(k)
|
||||
// If there is exactly one printable character, return that.
|
||||
if s == len(k) && unicode.IsPrint(r) {
|
||||
return strings.ToUpper(k), true
|
||||
return key.Name(strings.ToUpper(k)), true
|
||||
}
|
||||
return "", false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user