summaryrefslogtreecommitdiffstats
path: root/pkg/gui/types
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-03-26 15:02:32 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-03-27 18:16:16 +1100
commit98e7ec090509f089a3196848c324fdce2fb462fc (patch)
treecda5fcc6bf2ee5f442dff68fde121ef9ff3754b9 /pkg/gui/types
parent7128d822cb82beba890aad4dd39e51270598cf0b (diff)
add type alias for Key
Diffstat (limited to 'pkg/gui/types')
-rw-r--r--pkg/gui/types/context.go2
-rw-r--r--pkg/gui/types/keybindings.go4
2 files changed, 4 insertions, 2 deletions
diff --git a/pkg/gui/types/context.go b/pkg/gui/types/context.go
index 1f7d753e7..6f026fe73 100644
--- a/pkg/gui/types/context.go
+++ b/pkg/gui/types/context.go
@@ -97,7 +97,7 @@ type OnFocusOpts struct {
type ContextKey string
type KeybindingsOpts struct {
- GetKey func(key string) interface{}
+ GetKey func(key string) Key
Config config.KeybindingConfig
Guards KeybindingGuards
}
diff --git a/pkg/gui/types/keybindings.go b/pkg/gui/types/keybindings.go
index 7d1befc1b..b4db46336 100644
--- a/pkg/gui/types/keybindings.go
+++ b/pkg/gui/types/keybindings.go
@@ -2,6 +2,8 @@ package types
import "github.com/jesseduffield/gocui"
+type Key interface{} // FIXME: find out how to get `gocui.Key | rune`
+
// Binding - a keybinding mapping a key and modifier to a handler. The keypress
// is only handled if the given view has focus, or handled globally if the view
// is ""
@@ -9,7 +11,7 @@ type Binding struct {
ViewName string
Contexts []string
Handler func() error
- Key interface{} // FIXME: find out how to get `gocui.Key | rune`
+ Key Key
Modifier gocui.Modifier
Description string
Alternative string