i3
bindings.h
Go to the documentation of this file.
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
6  *
7  * bindings.h: Functions for configuring, finding, and running bindings.
8  *
9  */
10 #pragma once
11 
12 extern pid_t command_error_nagbar_pid;
13 
18 extern const char *DEFAULT_BINDING_MODE;
19 
26 Binding *configure_binding(const char *bindtype, const char *modifiers, const char *input_code,
27  const char *release, const char *border, const char *whole_window,
28  const char *command, const char *mode, bool pango_markup);
29 
34 void grab_all_keys(xcb_connection_t *conn);
35 
41 void regrab_all_buttons(xcb_connection_t *conn);
42 
48 Binding *get_binding_from_xcb_event(xcb_generic_event_t *event);
49 
54 void translate_keysyms(void);
55 
60 void switch_mode(const char *new_mode);
61 
75 void reorder_bindings(void);
76 
85 
89 void binding_free(Binding *bind);
90 
98 CommandResult *run_binding(Binding *bind, Con *con);
99 
104 bool load_keymap(void);
105 
Binding * configure_binding(const char *bindtype, const char *modifiers, const char *input_code, const char *release, const char *border, const char *whole_window, const char *command, const char *modename, bool pango_markup)
Adds a binding from config parameters given as strings and returns a pointer to the binding structure...
Definition: bindings.c:56
Binding * get_binding_from_xcb_event(xcb_generic_event_t *event)
Returns a pointer to the Binding that matches the given xcb event or NULL if no such binding exists...
Definition: bindings.c:259
void reorder_bindings(void)
Reorders bindings by event_state_mask descendingly so that get_binding() correctly matches more speci...
Definition: bindings.c:547
xcb_connection_t * conn
XCB connection and root screen.
Definition: main.c:43
void check_for_duplicate_bindings(struct context *context)
Checks for duplicate key bindings (the same keycode or keysym is configured more than once)...
Definition: bindings.c:564
bool bindings_should_grab_scrollwheel_buttons(void)
Returns true if the current config has any binding to a scroll wheel button (4 or 5) which is a whole...
Definition: bindings.c:820
void binding_free(Binding *bind)
Frees the binding.
Definition: bindings.c:628
bool load_keymap(void)
Loads the XKB keymap from the X11 server and feeds it to xkbcommon.
Definition: bindings.c:764
CommandResult * run_binding(Binding *bind, Con *con)
Runs the given binding and handles parse errors.
Definition: bindings.c:646
pid_t command_error_nagbar_pid
Definition: bindings.c:17
void switch_mode(const char *new_mode)
Switches the key bindings to the given mode, if the mode exists.
Definition: bindings.c:466
void regrab_all_buttons(xcb_connection_t *conn)
Release the button grabs on all managed windows and regrab them, reevaluating which buttons need to b...
Definition: bindings.c:154
A 'Con' represents everything from the X11 root window down to a single X11 window.
Definition: data.h:544
A struct that contains useful information about the result of a command as a whole (e...
void grab_all_keys(xcb_connection_t *conn)
Grab the bound keys (tell X to send us keypress events for those keycodes)
Definition: bindings.c:132
const char * DEFAULT_BINDING_MODE
The name of the default mode.
Definition: bindings.c:23
void translate_keysyms(void)
Translates keysymbols to keycodes for all bindings which use keysyms.
Definition: bindings.c:349
Used during the config file lexing/parsing to keep the state of the lexer in order to provide useful ...
Definition: config.h:32
Holds a keybinding, consisting of a keycode combined with modifiers and the command which is executed...
Definition: data.h:250