|
i3
|

Go to the source code of this file.
Macros | |
| #define | GRAB_KEY(modifier) |
Functions | |
| static struct Mode * | mode_from_name (const char *name) |
| Binding * | configure_binding (const char *bindtype, const char *modifiers, const char *input_code, const char *release, const char *whole_window, const char *command, const char *modename) |
| Adds a binding from config parameters given as strings and returns a pointer to the binding structure. More... | |
| static void | grab_keycode_for_binding (xcb_connection_t *conn, Binding *bind, uint32_t keycode) |
| 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) More... | |
| static Binding * | get_binding (uint16_t modifiers, bool is_release, uint16_t input_code, input_type_t input_type) |
| 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. More... | |
| void | translate_keysyms (void) |
| Translates keysymbols to keycodes for all bindings which use keysyms. More... | |
| void | switch_mode (const char *new_mode) |
| Switches the key bindings to the given mode, if the mode exists. More... | |
| void | check_for_duplicate_bindings (struct context *context) |
| Checks for duplicate key bindings (the same keycode or keysym is configured more than once). More... | |
| static Binding * | binding_copy (Binding *bind) |
| void | binding_free (Binding *bind) |
| Frees the binding. More... | |
| CommandResult * | run_binding (Binding *bind, Con *con) |
| Runs the given binding and handles parse errors. More... | |
Variables | |
| pid_t | command_error_nagbar_pid = -1 |
| const char * | DEFAULT_BINDING_MODE = "default" |
| #define GRAB_KEY | ( | modifier | ) |
Definition at line 388 of file bindings.c.
References Binding::command, Binding::number_keycodes, smalloc(), Binding::symbol, and Binding::translated_to.
Referenced by run_binding().

| void binding_free | ( | Binding * | bind | ) |
Frees the binding.
If bind is null, it simply returns.
Definition at line 405 of file bindings.c.
References Binding::command, FREE, Binding::symbol, and Binding::translated_to.
Referenced by load_configuration(), and run_binding().
| void check_for_duplicate_bindings | ( | struct context * | context | ) |
Checks for duplicate key bindings (the same keycode or keysym is configured more than once).
If a duplicate binding is found, a message is printed to stderr and the has_errors variable is set to true, which will start i3-nagbar.
Definition at line 339 of file bindings.c.
References bindings, Binding::command, ELOG, context::has_errors, Binding::input_type, Binding::keycode, Binding::mods, Binding::release, Binding::symbol, and TAILQ_FOREACH.
Referenced by parse_file().
| Binding* configure_binding | ( | const char * | bindtype, |
| const char * | modifiers, | ||
| const char * | input_code, | ||
| const char * | release, | ||
| const char * | whole_window, | ||
| const char * | command, | ||
| const char * | mode | ||
| ) |
Adds a binding from config parameters given as strings and returns a pointer to the binding structure.
Returns NULL if the input code could not be parsed.
Definition at line 51 of file bindings.c.
References B_KEYBOARD, B_MOUSE, bindings, Mode::bindings, Binding::command, DLOG, ELOG, FREE, Binding::input_type, Binding::keycode, mode_from_name(), modifiers_from_str(), Binding::mods, Binding::release, scalloc(), sstrdup(), Binding::symbol, TAILQ_INSERT_TAIL, and Binding::whole_window.
Referenced by CFGFUN().

|
static |
Definition at line 133 of file bindings.c.
References B_KEYBOARD, bindings, Binding::input_type, Binding::keycode, Binding::mods, Binding::number_keycodes, Binding::release, Binding::symbol, TAILQ_END, TAILQ_FOREACH, and Binding::translated_to.
Referenced by get_binding_from_xcb_event().
| 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 at line 196 of file bindings.c.
References B_KEYBOARD, B_MOUSE, BIND_MODE_SWITCH, DLOG, get_binding(), xcb_numlock_mask, and xkb_current_group.
Referenced by handle_key_press(), and route_click().

| 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 at line 108 of file bindings.c.
References B_KEYBOARD, BIND_MODE_SWITCH, bindings, grab_keycode_for_binding(), Binding::input_type, Binding::keycode, Binding::mods, Binding::number_keycodes, TAILQ_FOREACH, and Binding::translated_to.
Referenced by handle_event(), handle_mapping_notify(), load_configuration(), main(), and switch_mode().

|
static |
Definition at line 82 of file bindings.c.
References B_KEYBOARD, BIND_MODE_SWITCH, DLOG, GRAB_KEY, Binding::input_type, Binding::mods, and xcb_numlock_mask.
Referenced by grab_all_keys().
|
static |
Definition at line 26 of file bindings.c.
References Mode::bindings, modes, Mode::name, scalloc(), SLIST_FOREACH, SLIST_INSERT_HEAD, sstrdup(), and TAILQ_INIT.
Referenced by configure_binding().

| CommandResult* run_binding | ( | Binding * | bind, |
| Con * | con | ||
| ) |
Runs the given binding and handles parse errors.
If con is passed, it will execute the command binding with that container selected by criteria. Returns a CommandResult for running the binding's command. Caller should render tree if needs_tree_render is true. Free with command_result_free().
Definition at line 423 of file bindings.c.
References binding_copy(), binding_free(), Binding::command, command_error_nagbar_pid, config, errorfilename, Config::font, ipc_send_binding_event(), CommandResult::needs_tree_render, parse_command(), CommandResult::parse_error, Font::pattern, sasprintf(), sstrdup(), start_nagbar(), and tree_render().
Referenced by handle_key_press(), and route_click().

| void switch_mode | ( | const char * | new_mode | ) |
Switches the key bindings to the given mode, if the mode exists.
Definition at line 306 of file bindings.c.
References bindings, Mode::bindings, conn, DLOG, ELOG, FREE, grab_all_keys(), ipc_send_event(), modes, Mode::name, sasprintf(), SLIST_FOREACH, translate_keysyms(), and ungrab_all_keys().
Referenced by cmd_mode().

| void translate_keysyms | ( | void | ) |
Translates keysymbols to keycodes for all bindings which use keysyms.
Definition at line 246 of file bindings.c.
References B_MOUSE, BIND_MODE_SWITCH, bindings, conn, DLOG, ELOG, FREE, Binding::input_type, Binding::keycode, keysyms, Binding::mods, Binding::number_keycodes, srealloc(), Binding::symbol, TAILQ_FOREACH, and Binding::translated_to.
Referenced by handle_event(), handle_mapping_notify(), load_configuration(), main(), and switch_mode().

| pid_t command_error_nagbar_pid = -1 |
Definition at line 13 of file bindings.c.
Referenced by cmd_reload(), i3_restart(), and run_binding().
| const char* DEFAULT_BINDING_MODE = "default" |
Definition at line 19 of file bindings.c.
Referenced by CFGFUN().
1.8.9.1