i3
bindings.h
Go to the documentation of this file.
1/*
2 * vim:ts=4:sw=4:expandtab
3 *
4 * i3 - an improved 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#include <config.h>
13
14extern pid_t command_error_nagbar_pid;
15
20extern const char *DEFAULT_BINDING_MODE;
21
28Binding *configure_binding(const char *bindtype, const char *modifiers, const char *input_code,
29 const char *release, const char *border, const char *whole_window,
30 const char *exclude_titlebar, const char *command, const char *mode,
31 bool pango_markup);
32
37void grab_all_keys(xcb_connection_t *conn);
38
44void regrab_all_buttons(xcb_connection_t *conn);
45
51Binding *get_binding_from_xcb_event(xcb_generic_event_t *event);
52
57void translate_keysyms(void);
58
63void switch_mode(const char *new_mode);
64
78void reorder_bindings(void);
79
88
92void binding_free(Binding *bind);
93
102
107bool load_keymap(void);
108
xcb_connection_t * conn
XCB connection and root screen.
Definition main.c:54
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 *exclude_titlebar, const char *command, const char *mode, bool pango_markup)
Adds a binding from config parameters given as strings and returns a pointer to the binding structure...
Definition bindings.c:59
void binding_free(Binding *bind)
Frees the binding.
Definition bindings.c:836
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:784
bool load_keymap(void)
Loads the XKB keymap from the X11 server and feeds it to xkbcommon.
Definition bindings.c:983
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:155
const char * DEFAULT_BINDING_MODE
The name of the default mode.
Definition bindings.c:25
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:315
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:187
int * bindings_get_buttons_to_grab(void)
Returns a list of buttons that should be grabbed on a window.
Definition bindings.c:1036
void switch_mode(const char *new_mode)
Switches the key bindings to the given mode, if the mode exists.
Definition bindings.c:639
pid_t command_error_nagbar_pid
Definition bindings.c:19
CommandResult * run_binding(Binding *bind, Con *con)
Runs the given binding and handles parse errors.
Definition bindings.c:859
void reorder_bindings(void)
Reorders bindings by event_state_mask descendingly so that get_binding() correctly matches more speci...
Definition bindings.c:732
void translate_keysyms(void)
Translates keysymbols to keycodes for all bindings which use keysyms.
Definition bindings.c:449
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 ...
Holds a keybinding, consisting of a keycode combined with modifiers and the command which is executed...
Definition data.h:306
A 'Con' represents everything from the X11 root window down to a single X11 window.
Definition data.h:643