summaryrefslogtreecommitdiffstats
path: root/pkg/gui/types/keybindings.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-01-28 20:44:36 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-03-17 19:13:40 +1100
commita90b6efded49abcfa2516db794d7875b0396f558 (patch)
treead9c3738830437064ada223f0978dab1d726b479 /pkg/gui/types/keybindings.go
parentfa8571e1f4c349e401542285ea238acdbd9d17ec (diff)
start refactoring gui
Diffstat (limited to 'pkg/gui/types/keybindings.go')
-rw-r--r--pkg/gui/types/keybindings.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/gui/types/keybindings.go b/pkg/gui/types/keybindings.go
new file mode 100644
index 000000000..abe3f84d0
--- /dev/null
+++ b/pkg/gui/types/keybindings.go
@@ -0,0 +1,18 @@
+package types
+
+import "github.com/jesseduffield/gocui"
+
+// 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 ""
+type Binding struct {
+ ViewName string
+ Contexts []string
+ Handler func() error
+ Key interface{} // FIXME: find out how to get `gocui.Key | rune`
+ Modifier gocui.Modifier
+ Description string
+ Alternative string
+ Tag string // e.g. 'navigation'. Used for grouping things in the cheatsheet
+ OpensMenu bool
+}