17 class GlobalCommandController;
18 class EventDistributor;
27 bool repeat_ =
false,
bool passEvent_ =
false)
37 using KeySet = std::vector<EventPtr>;
53 void initDefaultBindings();
54 void bind (HotKeyInfo&& info);
56 void bindDefault (HotKeyInfo&& info);
57 void unbindDefault(
const EventPtr& event);
58 void bindLayer (HotKeyInfo&& info,
const std::string& layer);
59 void unbindLayer (
const EventPtr& event,
const std::string& layer);
60 void unbindFullLayer(
const std::string& layer);
61 void activateLayer (std::string layer,
bool blocking);
62 void deactivateLayer(std::string_view layer);
64 int executeEvent(
const EventPtr& event);
65 void executeBinding(
const EventPtr& event,
const HotKeyInfo& info);
66 void startRepeat (
const EventPtr& event);
70 int signalEvent(
const EventPtr& event)
override;
72 void executeRT()
override;
75 class BindCmd final :
public Command {
80 [[nodiscard]] std::string help(
const std::vector<std::string>& tokens)
const override;
83 const bool defaultCmd;
86 BindCmd bindDefaultCmd;
88 class UnbindCmd final :
public Command {
90 UnbindCmd(CommandController& commandController,
HotKey& hotKey,
93 [[nodiscard]] std::string help(
const std::vector<std::string>& tokens)
const override;
96 const bool defaultCmd;
99 UnbindCmd unbindDefaultCmd;
101 struct ActivateCmd final : Command {
102 explicit ActivateCmd(CommandController& commandController);
104 [[nodiscard]] std::string help(
const std::vector<std::string>& tokens)
const override;
107 struct DeactivateCmd final : Command {
108 explicit DeactivateCmd(CommandController& commandController);
110 [[nodiscard]] std::string help(
const std::vector<std::string>& tokens)
const override;
115 std::map<std::string, BindMap> layerMap;
116 std::vector<LayerInfo> activeLayers;
119 GlobalCommandController& commandController;
120 EventDistributor& eventDistributor;