aboutsummaryrefslogtreecommitdiffstats
path: root/app/account-wizard.go
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2024-02-12 06:26:19 -0600
committerRobin Jarry <robin@jarry.cc>2024-02-12 13:48:48 +0100
commitcdc90afbaa1a6ff7d0900b6ce904a1e51e31bcd1 (patch)
tree4765fa753846ffe5a9d07c1fe442e8e1f2db0c61 /app/account-wizard.go
parentf001f65240f85f0af91703dbcc0b068c0797297a (diff)
downloadaerc-cdc90afbaa1a6ff7d0900b6ce904a1e51e31bcd1.tar.gz
aerc: replace tcell keys with vaxis keys
Replace all instances of tcell key usage with vaxis keys Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'app/account-wizard.go')
-rw-r--r--app/account-wizard.go22
1 files changed, 9 insertions, 13 deletions
diff --git a/app/account-wizard.go b/app/account-wizard.go
index 0fd426ca..36bc0392 100644
--- a/app/account-wizard.go
+++ b/app/account-wizard.go
@@ -13,7 +13,6 @@ import (
"sync"
"github.com/emersion/go-message/mail"
- "github.com/gdamore/tcell/v2"
"github.com/go-ini/ini"
"golang.org/x/sys/unix"
@@ -750,13 +749,11 @@ func (wizard *AccountWizard) Focus(focus bool) {
func (wizard *AccountWizard) Event(event vaxis.Event) bool {
interactive := wizard.getInteractive()
- if event, ok := event.(*tcell.EventKey); ok {
- switch event.Key() {
- case tcell.KeyUp:
- fallthrough
- case tcell.KeyBacktab:
- fallthrough
- case tcell.KeyCtrlK:
+ if key, ok := event.(vaxis.Key); ok {
+ switch {
+ case key.Matches('k', vaxis.ModCtrl),
+ key.Matches(vaxis.KeyTab, vaxis.ModShift),
+ key.Matches(vaxis.KeyUp):
if interactive != nil {
interactive[wizard.focus].Focus(false)
wizard.focus--
@@ -767,11 +764,10 @@ func (wizard *AccountWizard) Event(event vaxis.Event) bool {
}
wizard.Invalidate()
return true
- case tcell.KeyDown:
- fallthrough
- case tcell.KeyTab:
- fallthrough
- case tcell.KeyCtrlJ:
+ case key.Matches('j', vaxis.ModCtrl),
+ key.Matches(vaxis.KeyTab),
+ key.Matches(vaxis.KeyDown):
+
if interactive != nil {
interactive[wizard.focus].Focus(false)
wizard.focus++