aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ui
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2024-02-19 18:19:55 -0600
committerRobin Jarry <robin@jarry.cc>2024-02-22 21:46:15 +0100
commit3c01fd0fcd030b8bbe68f0208c8b4467dcd1ed89 (patch)
tree445401eba01b71f7b1e6782581b98f269ea398b6 /lib/ui
parent7917372e94e13a478003c3c4663c3e2239e7b032 (diff)
downloadaerc-3c01fd0fcd030b8bbe68f0208c8b4467dcd1ed89.tar.gz
ui: enable CSIu key encoding
Enable CSIu key encoding protocol when support is detected. This will enable keybinds which traditionally have been unavailable due to conflicting with other keys (C-i, C-m, C-[, etc). Remove numlock and capslock from all keypresses to prevent interfering with key matching. Changelog-added: Virtually any key binding can now be configured in `binds.conf`, including Shift+Alt+Control modifier combinations. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/ui')
-rw-r--r--lib/ui/ui.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/ui/ui.go b/lib/ui/ui.go
index d63ebf36..3b1050b5 100644
--- a/lib/ui/ui.go
+++ b/lib/ui/ui.go
@@ -49,8 +49,7 @@ var state struct {
func Initialize(content DrawableInteractive) error {
opts := vaxis.Options{
- DisableMouse: !config.Ui.MouseEnabled,
- DisableKittyKeyboard: true,
+ DisableMouse: !config.Ui.MouseEnabled,
}
vx, err := vaxis.New(opts)
if err != nil {
@@ -144,6 +143,13 @@ func HandleEvent(event vaxis.Event) {
case vaxis.Redraw:
Invalidate()
default:
+ // We never care about num or caps lock. Remove them so it
+ // doesn't interefere with key matching
+ if key, ok := event.(vaxis.Key); ok {
+ key.Modifiers &^= vaxis.ModCapsLock
+ key.Modifiers &^= vaxis.ModNumLock
+ event = key
+ }
// if we have a popover, and it can handle the event, it does so
if state.popover == nil || !state.popover.Event(event) {
// otherwise, we send the event to the main content