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-2014 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 
19 
26 Binding *configure_binding(const char *bindtype, const char *modifiers, const char *input_code,
27  const char *release, const char *command, const char *mode);
28 
33 void grab_all_keys(xcb_connection_t *conn, bool bind_mode_switch);
34 
40 Binding *get_binding_from_xcb_event(xcb_generic_event_t *event);
41 
46 void translate_keysyms(void);
47 
52 void switch_mode(const char *new_mode);
53 
62 
void grab_all_keys(xcb_connection_t *conn, bool bind_mode_switch)
Grab the bound keys (tell X to send us keypress events for those keycodes)
Definition: bindings.c:105
CommandResult * run_binding(Binding *bind)
Runs the given binding and handles parse errors.
Definition: bindings.c:387
xcb_connection_t * conn
Definition: main.c:47
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:192
const char * DEFAULT_BINDING_MODE
The name of the default mode.
Definition: bindings.h:18
pid_t command_error_nagbar_pid
Definition: bindings.c:11
Binding * configure_binding(const char *bindtype, const char *modifiers, const char *input_code, const char *release, const char *command, const char *mode)
Adds a binding from config parameters given as strings and returns a pointer to the binding structure...
Definition: bindings.c:49
Holds a keybinding, consisting of a keycode combined with modifiers and the command which is executed...
Definition: data.h:231
A struct that contains useful information about the result of a command as a whole (e...
Used during the config file lexing/parsing to keep the state of the lexer in order to provide useful ...
Definition: config.h:32
void translate_keysyms(void)
Translates keysymbols to keycodes for all bindings which use keysyms.
Definition: bindings.c:242
void switch_mode(const char *new_mode)
Switches the key bindings to the given mode, if the mode exists.
Definition: bindings.c:302
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:335