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 / 3 and Ctrl+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-layout after 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 v0.4.2

YNAB-style envelope budgeting: a derivation engine

Authors

  • Matt Doughty

License

Artistic-2.0

Dependencies

DBIish:ver<0.6.7>:auth<zef:raku-community-modules>Notcurses::Native:ver<0.6.5+>:auth<zef:apogee>Selkie:ver<0.16.0+>:auth<zef:apogee>JSON::Fast:ver<0.19>:auth<cpan:TIMOTIMO>MacOS::NativeLib:ver<0.0.6>:auth<zef:lizmat>

Test Dependencies

Provides

  • App::Moneymoor
  • App::Moneymoor::Config
  • App::Moneymoor::DB
  • App::Moneymoor::Gateway::Account
  • App::Moneymoor::Gateway::Assignment
  • App::Moneymoor::Gateway::Category
  • App::Moneymoor::Gateway::Payee
  • App::Moneymoor::Gateway::Transaction
  • App::Moneymoor::Handlers::Boot
  • App::Moneymoor::Model::Account
  • App::Moneymoor::Model::Assignment
  • App::Moneymoor::Model::Category
  • App::Moneymoor::Model::CategoryGroup
  • App::Moneymoor::Model::Payee
  • App::Moneymoor::Model::Split
  • App::Moneymoor::Model::Transaction
  • App::Moneymoor::Screen::Accounts
  • App::Moneymoor::Screen::Budget
  • App::Moneymoor::Screen::Login
  • App::Moneymoor::Screen::Main
  • App::Moneymoor::Screen::Main::Keybinds
  • App::Moneymoor::Screen::Main::Modals
  • App::Moneymoor::Screen::Main::Subscriptions
  • App::Moneymoor::Screen::Reports
  • App::Moneymoor::Service::Budget
  • App::Moneymoor::Service::Icons
  • App::Moneymoor::Service::Target
  • App::Moneymoor::Service::Workspace
  • App::Moneymoor::StoreHandlers
  • App::Moneymoor::Theme
  • App::Moneymoor::Theme::Catppuccin
  • App::Moneymoor::Theme::Dracula
  • App::Moneymoor::Theme::Everforest
  • App::Moneymoor::Theme::Gruvbox
  • App::Moneymoor::Theme::Kanagawa
  • App::Moneymoor::Theme::Monokai
  • App::Moneymoor::Theme::Nord
  • App::Moneymoor::Theme::OneDark
  • App::Moneymoor::Theme::RosePine
  • App::Moneymoor::Theme::Solarized
  • App::Moneymoor::Theme::TokyoNight
  • App::Moneymoor::Themes
  • App::Moneymoor::UI
  • App::Moneymoor::Util::Money
  • App::Moneymoor::Util::Period
  • App::Moneymoor::View::BudgetRow
  • App::Moneymoor::View::EmptyState
  • App::Moneymoor::View::HintBar
  • App::Moneymoor::View::InspectorPane
  • App::Moneymoor::View::ModalChrome
  • App::Moneymoor::View::RegisterRow
  • App::Moneymoor::View::ReportRow
  • App::Moneymoor::Widget::BannerBar
  • App::Moneymoor::Widget::BootProgressModal

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite โ€” the markup and publishing tools behind this site.