CommandRegistry + CommandHandler + CommandInfo + ShortcutMap — Pulp-native command dispatch and keyboard-shortcut routing. More...
#include <pulp/view/input_events.hpp>#include <cstdint>#include <functional>#include <optional>#include <string>#include <string_view>#include <unordered_map>#include <vector>Go to the source code of this file.
Classes | |
| struct | pulp::view::CommandInfo |
| Metadata for one command. More... | |
| class | pulp::view::CommandHandler |
| Interface implemented by any object that can perform commands. More... | |
| class | pulp::view::ShortcutMap |
| (KeyCode, modifiers) → CommandID lookup table. More... | |
| struct | pulp::view::ShortcutMap::Chord |
| All chords currently bound to the given command. More... | |
| class | pulp::view::CommandRegistry |
| Central command dispatcher. More... | |
Namespaces | |
| namespace | pulp |
| namespace | pulp::state |
| SequencerStateChannel is the audio-safe transport for a plugin's structured NON-parameter state: the bulk, observable state a step sequencer / mod-matrix / pattern engine holds outside its automatable parameter set (e.g. | |
| namespace | pulp::view |
| Hover-cursor tracking for platform window hosts. | |
Functions | |
| CommandInfo | pulp::view::make_open_settings_command_info () |
| CommandInfo for kCommandOpenSettings with the platform-standard chord as its default binding. | |
| void | pulp::view::route_global_keys (View &root, CommandRegistry ®istry) |
| Install registry as the root view's single global-key dispatcher: assigns root.on_global_key to forward every key event into registry.dispatch_key_event(). | |
Variables | |
| constexpr CommandID | pulp::view::kInvalidCommandID = 0 |
| constexpr KeyCode | pulp::view::kKeyComma = static_cast<KeyCode>(',') |
| ASCII comma as a KeyCode. | |
| constexpr CommandID | pulp::view::kCommandOpenSettings = 0x504C5354 |
| Framework-reserved CommandID for "open the app's settings / preferences" (ASCII 'PLST'). | |
| constexpr std::uint16_t | pulp::view::kOpenSettingsModifiers = kModCmd |
| The platform-standard open-settings chord: Cmd+, on macOS, Ctrl+, elsewhere. | |
CommandRegistry + CommandHandler + CommandInfo + ShortcutMap — Pulp-native command dispatch and keyboard-shortcut routing.
The primitives are named for Pulp's command model rather than mirroring any reference framework's class names. The behavior contract is "a key event finds the topmost focused handler that claims a command and dispatches to it".
The registry exposes dispatch_key_event(const KeyEvent&) which:
The contract intentionally lets the host integrate two ways: (a) call dispatch_key_event BEFORE the normal on_key_event delivery — global shortcuts win; (b) call it AFTER — focused widget wins, with the registry as a fall-through after focused-widget handling.
ShortcutMap::save_to(PropertiesFile&) and load_from(PropertiesFile&) round-trip the user's rebindings through Pulp's pulp::state::ApplicationProperties (user settings file). The editor UI calls save() on every commit so changes survive a restart.