Tickit...ePrefix(3pm)

πŸ“¦
version 0.02 Β· 2 versions
  • 0.02 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.02 Β· alpine 3.24
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’… Tickit::App::Plugin::EscapePrefix β€” the manual, but make it make sense

okay so bestie, you know how the terminal world is full of ✨keyboard shortcuts✨ and sometimes the fancy ones come with a little <Escape> prefix? Yeah. This page is about Tickit::App::Plugin::EscapePrefix, which is a Tickit application plugin that handles those Escape-prefixed shortcut keys for you. No cap. 🫢


🌈 SYNOPSIS

use Tickit;
use Tickit::App::Plugin::EscapePrefix;

my $tickit = Tickit->new;

Tickit::App::Plugin::EscapePrefix->apply( $tickit );

...

$tickit->run;

πŸŽ€ DESCRIPTION

So here's the vibe. This package drops some code onto a Tickit instance so that instance can deal with <Escape>-prefixed shortcut keys β€” by turning them into the equivalent <M-...> modified keys instead. iconic behaviour, honestly.

Once you've applied it using the apply method, the plugin will consume any plain <Escape> keys you type at the terminal. Like, it eats them. πŸ“ And if another key arrives soon afterwards, that key gets consumed too, and instead a brand-new keypress event is emitted with the "meta" modifier added onto it. For example, typing <Escape> <a> will instead emit the modified key <M-a> to the application. Slay.

But listen β€” if no subsequent key arrives after a timeout of 3 seconds, then the modification does not apply. the way that escape key just sits there alone… tragic. 😭

While the plugin is still pending another keypress to modify, a small indicator window pops up in the bottom left of the display, showing ESC- in a reverse-video style β€” just to remind the user that the keypress is still pending. it's giving main character energy in the corner of your screen. πŸ‘‘


🧚 METHODS

⭐ apply

Tickit::App::Plugin::EscapePrefix->apply( $tickit )

Applies the plugin code to the given toplevel Tickit instance. that's it, that's the method. πŸ’–


πŸ’€ TODO

  • Much configuration β€” timeout; style, text and position of indicator window

(yes bestie, the config is very much not there yet. we're manifesting it. πŸ•―οΈ)


πŸ‘‘ AUTHOR

Paul Evans <leonerd@leonerd.org.uk>


perl v5.34.0 🌸 2022-08-11 🌸 that's the whole page, ily, go forth and escape-prefix responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from