Keybinds
NAME
App::Moneymoor::Screen::Main::Keybinds - keybind installation for the Main shell, extracted so the screen class stays readable.
SYNOPSIS
use App::Moneymoor::Screen::Main::Keybinds;
App::Moneymoor::Screen::Main::Keybinds::install-global($main);
App::Moneymoor::Screen::Main::Keybinds::install-content($main);
DESCRIPTION
Two install subs:
install-globalโ binds on the screen root, so they fire from anywhere on the Main screen regardless of which pane has focus:1/2/3andCtrl+1/Ctrl+2/Ctrl+3(tab switch),[/](period navigation),Ctrl+G(diagnostics),Ctrl+O(settings),Ctrl+H(the keybind overlay). Registered once, at build time.install-contentโ binds on the current tab's panes, so they only fire when that pane has focus. Re-run by!refresh-content-layoutafter a tab change, because the widgets they bind to are new objects each time.
Selkie's own defaults โ Tab, Shift+Tab, Esc, Ctrl+Q โ are untouched.
Why the period keys are root-level and unmodified
[ and ] are bare characters, which Selkie refuses for
app-global binds (Selkie::App.on-key demands a modifier so a
global can't eat text input). These are widget binds on the screen
root: a keypress starts at the focused widget and bubbles up, so they
fire only if nothing on the way up consumed them. A TextInput inside
a modal consumes its own characters, and modals route separately
anyway, so a user typing [ into a memo field never navigates the
budget.
The period is global state โ the banner, the envelope table and the
reports chart all read app/period โ so the binds are global too
rather than duplicated onto two tabs' panes.
The FQN trap
our sub inside a unit module is only reachable as
Pkg::Name::sub-name(...) from a caller that itself has
use Pkg::Name. Without the use below, this module would compile
cleanly and the keybind closures would explode the first time a user
pressed the key โ "Could not find symbol '&open-settings'" โ because
the lookup happens at runtime, inside the closure. That is why
Modals is used here even though nothing in this file mentions
the module at compile time.
SEE ALSO
App::Moneymoor::Screen::Main::Modals โ what the modal binds open.
App::Moneymoor::View::HintBar โ the footer that advertises these.