KeymapSystem::KeyActionAdapter
KeymapSystem::KeyActionAdapter
Component for receiving keymap dispatches via composition. More…
#include <KeyActionAdapter.hpp>
Inherits from QObject
Public Types
| Name | |
|---|---|
| using std::function< bool(QString const &)> | Handler Callback type: receives action_id, returns true if handled. |
Public Functions
| Name | |
|---|---|
| KeyActionAdapter(QObject * parent =[nullptr]) | |
| void | setHandler(Handler handler) Set the handler called when an action is dispatched to this adapter. |
| bool | handleKeyAction(QString const & action_id) Called by KeymapManager to dispatch an action. |
| void | setInstanceId(EditorLib::EditorInstanceId const & id) Set the EditorInstanceId this adapter is associated with. |
| EditorLib::EditorInstanceId | instanceId() const Get the EditorInstanceId this adapter is associated with. |
| void | setTypeId(EditorLib::EditorTypeId const & id) Set the EditorTypeId this adapter is associated with. |
| EditorLib::EditorTypeId | typeId() const Get the EditorTypeId this adapter is associated with. |
Detailed Description
class KeymapSystem::KeyActionAdapter;Component for receiving keymap dispatches via composition.
Usage:
// In widget constructor:
_key_adapter = new KeyActionAdapter(this); // QObject parenting
_key_adapter->setInstanceId(_state->getInstanceId());
_key_adapter->setHandler([this](QString const & action_id) -> bool {
if (action_id == "media.assign_group_1") {
assignToGroup(1);
return true;
}
return false;
});
keymap_manager->registerAdapter(_key_adapter);Public Types Documentation
using Handler
using KeymapSystem::KeyActionAdapter::Handler = std::function<bool(QString const &)>;Callback type: receives action_id, returns true if handled.
Public Functions Documentation
function KeyActionAdapter
explicit KeyActionAdapter(
QObject * parent =nullptr
)function setHandler
void setHandler(
Handler handler
)Set the handler called when an action is dispatched to this adapter.
function handleKeyAction
bool handleKeyAction(
QString const & action_id
)Called by KeymapManager to dispatch an action.
Parameters:
- action_id The action to handle
Return: true if the action was handled
function setInstanceId
void setInstanceId(
EditorLib::EditorInstanceId const & id
)Set the EditorInstanceId this adapter is associated with.
function instanceId
EditorLib::EditorInstanceId instanceId() constGet the EditorInstanceId this adapter is associated with.
function setTypeId
void setTypeId(
EditorLib::EditorTypeId const & id
)Set the EditorTypeId this adapter is associated with.
function typeId
EditorLib::EditorTypeId typeId() constGet the EditorTypeId this adapter is associated with.
Updated on 2026-11-13 at 20:25:42 +0000