Manages keyboard shortcuts with configurable bindings.
More...
#include <app_framework.hpp>
Manages keyboard shortcuts with configurable bindings.
[&] { save(); }});
[&] { undo(); }});
Manages keyboard shortcuts with configurable bindings.
Definition app_framework.hpp:63
void add_command(Command cmd)
bool handle_key(const KeyEvent &event)
Try to handle a key event by matching against registered shortcuts.
@ kModCmd
Command (macOS) — alias for platform primary modifier.
Definition input_events.hpp:21
@ s
Definition input_events.hpp:41
@ z
Definition input_events.hpp:42
A keyboard shortcut (key + modifiers).
Definition app_framework.hpp:23
◆ add_command()
| void pulp::view::KeyMapping::add_command |
( |
Command | cmd | ) |
|
◆ commands()
| const std::vector< Command > & pulp::view::KeyMapping::commands |
( |
| ) |
const |
|
inline |
Get all registered commands.
◆ commands_in_category()
| std::vector< const Command * > pulp::view::KeyMapping::commands_in_category |
( |
const std::string & | category | ) |
const |
Get commands in a specific category.
◆ handle_key()
| bool pulp::view::KeyMapping::handle_key |
( |
const KeyEvent & | event | ) |
|
Try to handle a key event by matching against registered shortcuts.
- Returns
- True if a matching command was found and executed.
◆ load_bindings()
| bool pulp::view::KeyMapping::load_bindings |
( |
const std::filesystem::path & | path | ) |
|
Load keybindings from a JSON file (overrides defaults).
◆ rebind()
Rebind a command's shortcut.
◆ remove_command()
| void pulp::view::KeyMapping::remove_command |
( |
CommandID | id | ) |
|
◆ save_bindings()
| bool pulp::view::KeyMapping::save_bindings |
( |
const std::filesystem::path & | path | ) |
const |
Save keybindings to a JSON file.
The documentation for this class was generated from the following file: