You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: include/i3ipc++/ipc.hpp
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,7 @@ enum EventType {
77
77
ET_MODE = (1 << 2), ///< Output mode event
78
78
ET_WINDOW = (1 << 3), ///< Window event
79
79
ET_BARCONFIG_UPDATE = (1 << 4), ///< Bar config update event @attention Yet is not implemented as signal in connection
80
+
ET_BINDING = (1 << 5), ///< Binding event
80
81
};
81
82
82
83
/**
@@ -130,6 +131,16 @@ enum class ContainerLayout : char {
130
131
};
131
132
132
133
134
+
/**
135
+
* A type of the input of bindings
136
+
*/
137
+
enumclassInputType : char {
138
+
UNKNOWN = '?', //< If got an unknown input_type in binding_event
139
+
KEYBOARD = 'k',
140
+
MOUSE = 'm',
141
+
};
142
+
143
+
133
144
/**
134
145
* A node of tree of windows
135
146
*/
@@ -174,6 +185,18 @@ struct window_event_t {
174
185
};
175
186
176
187
188
+
/**
189
+
* A binding
190
+
*/
191
+
structbinding_t {
192
+
std::string command; ///< The i3 command that is configured to run for this binding
193
+
std::vector<std::string> event_state_mask; ///< The group and modifier keys that were configured with this binding
194
+
int32_t input_code; ///< If the binding was configured with bindcode, this will be the key code that was given for the binding. If the binding is a mouse binding, it will be the number of the mouse button that was pressed. Otherwise it will be 0
195
+
std::string symbol; ///< If this is a keyboard binding that was configured with bindsym, this field will contain the given symbol. Otherwise it will be null
196
+
InputType input_type;
197
+
};
198
+
199
+
177
200
structbuf_t;
178
201
/**
179
202
* Connection to the i3
@@ -258,6 +281,7 @@ class connection {
258
281
sigc::signal<void> signal_mode_event; ///< Output mode event signal
259
282
sigc::signal<void, constwindow_event_t&> signal_window_event; ///< Window event signal
260
283
sigc::signal<void> signal_barconfig_update_event; ///< Barconfig update event signal
284
+
sigc::signal<void, constbinding_t&> signal_binding_event; ///< Binding event signal
261
285
sigc::signal<void, EventType, const std::shared_ptr<constbuf_t>&> signal_event; ///< i3 event signal @note Default handler routes event to signal according to type
0 commit comments