diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-05-09 16:01:22 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-05-09 16:01:22 -0400 |
| commit | 96865538c9188c9e9f36995e2b8a0eca8ddc0868 (patch) | |
| tree | 3cca7e6b3cd9b5cfa42d63a4c146b19bb4e4ce8a /main.go | |
| parent | 257f254bd9d15c74ac50934ca1a8ddeb73e1b617 (diff) | |
| download | volute-96865538c9188c9e9f36995e2b8a0eca8ddc0868.zip | |
allow widget to accept or deny request to shift focus
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -58,7 +58,7 @@ func run() { displacementChan, rpmChan, veChan, imapChan, actChan, flowChan, - &focus, + focus, mux, wg, ) @@ -83,8 +83,7 @@ func run() { ) } - focus.Focus(true) - eventLoop(env, &focus) + eventLoop(env, focus) } func eventLoop(env gui.Env, focus *widget.FocusMaster) { @@ -97,13 +96,13 @@ func eventLoop(env gui.Env, focus *widget.FocusMaster) { case 'q': return case 'h': - focus.TryLeft() + focus.Shift(widget.LEFT) case 'j': - focus.TryDown() + focus.Shift(widget.DOWN) case 'k': - focus.TryUp() + focus.Shift(widget.UP) case 'l': - focus.TryRight() + focus.Shift(widget.RIGHT) } } } |