From dba880a088899e00ada30145fbe0f870ee0ac2e1 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 9 Mar 2020 20:22:04 +0100 Subject: doc/foot.5: document key bindings --- doc/foot.5.scd | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'doc') diff --git a/doc/foot.5.scd b/doc/foot.5.scd index edfecc27..2946ddc8 100644 --- a/doc/foot.5.scd +++ b/doc/foot.5.scd @@ -147,6 +147,53 @@ component. *button-close-color* Close button's AARRGGBB color. Default: _ffff3030_. +# SECTION: key-bindings + +This section lets you override the default key bindings. + +The general format is *action*=*combo1*...*comboN*. That is, each +action may have one or more key combinations, space separated. Each +combination is on the form *mod1*+*mod2*+*key*. The names of the +modifiers and the key *must* be a valid XKB key name. + +Note that if *Shift* is one of the modifiers, the _key_ *must* be in +upper case. + +Note that _Alt_ is usually called *Mod1*. + +*scrollback-up* + Scrolls up/back in history. Default: _Shift+Page_Up_. + +*scrollback-down* + Scroll down/forward in history. Default: _Shift+Page_Down_. + +*clipboard-copy* + Copies the current selection into the _clipboard_. Default: _Control+Shift+C_. + +*clipboard-paste* + Pastes from the _clipboard_. Default: _Control+Shift+V_. + +*primary-paste* + Pastes from the _primary selection_. Default: not bound (to a + _key_, see *mouse-bindings*). + +*search-start* + Starts a scrollback/history search. Default: _Control+Shift+R_. + +*font-increase* + Increases the font size by 0.5pt. Default: _Control+plus + Control+equal Control+KP\_Add_. + +*font-decrease* + Decreases the font size by 0.5pt. Default: _Control+minus + Control+KP\_Subtract_. + +*font-reset* + Resets the font size to the default. Default: _Control+0 Control+KP\_0_. + +*spawn-terminal* + Spawns a new terminal. Default: _Control+Shift+Return_. + # FONT FORMAT The font is specified in FontConfig syntax. That is, a colon-separated -- cgit v1.3 From 214ef146a2a75f16e994ee27689ed36981d6c57f Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 9 Mar 2020 20:32:15 +0100 Subject: doc/foot.1: keyboard shortcuts: add pointer to foot(5) --- doc/foot.1.scd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/foot.1.scd b/doc/foot.1.scd index 5b3c07cc..cb060bb4 100644 --- a/doc/foot.1.scd +++ b/doc/foot.1.scd @@ -98,11 +98,13 @@ arguments, use *--*: # KEYBOARD SHORTCUTS -The following keyboard shortcuts are available. Note that they cannot -be changed. +The following keyboard shortcuts are available. ## NORMAL MODE +Note that these are just the defaults; they can be changed in the +*footrc*, see *foot*(5). + *shift*+*page up*/*page down* Scroll up/down in history -- cgit v1.3 From 65ff582358c07c8bb69f56dc8192c86d21b620d3 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 12 Mar 2020 09:34:09 +0100 Subject: bindings: add minimize/maximize/fullscreen actions These actions are by default not bound to anything. --- config.c | 6 ++++++ doc/foot.5.scd | 9 +++++++++ footrc | 3 +++ input.c | 18 ++++++++++++++++++ wayland.h | 3 +++ 5 files changed, 39 insertions(+) (limited to 'doc') diff --git a/config.c b/config.c index 62a060c0..19377b8a 100644 --- a/config.c +++ b/config.c @@ -58,8 +58,14 @@ static const char *binding_action_map[] = { [BIND_ACTION_FONT_SIZE_DOWN] = "font-decrease", [BIND_ACTION_FONT_SIZE_RESET] = "font-reset", [BIND_ACTION_SPAWN_TERMINAL] = "spawn-terminal", + [BIND_ACTION_MINIMIZE] = "minimize", + [BIND_ACTION_MAXIMIZE] = "maximize", + [BIND_ACTION_FULLSCREEN] = "fullscreen", }; +static_assert(ALEN(binding_action_map) == BIND_ACTION_COUNT, + "binding action map size mismatch"); + static char * get_shell(void) { diff --git a/doc/foot.5.scd b/doc/foot.5.scd index 2946ddc8..5c8becdf 100644 --- a/doc/foot.5.scd +++ b/doc/foot.5.scd @@ -194,6 +194,15 @@ Note that _Alt_ is usually called *Mod1*. *spawn-terminal* Spawns a new terminal. Default: _Control+Shift+Return_. +*minimize* + Minimizes the window. Default: _not bound_. + +*maximize* + Toggle the maximized state. Default: _not bound_. + +*fullscreen* + Toggles the fullscreen state. Default: _not bound_. + # FONT FORMAT The font is specified in FontConfig syntax. That is, a colon-separated diff --git a/footrc b/footrc index 60b2d516..468bc67d 100644 --- a/footrc +++ b/footrc @@ -53,3 +53,6 @@ # font-decrease=Control+minus Control+KP_Subtract # font-reset=Control+0 Control+KP_0 # spawn-terminal=Control+Shift+Return +# # minimize= +# # maximize= +# # fullscreen= diff --git a/input.c b/input.c index 96de8160..399d9d26 100644 --- a/input.c +++ b/input.c @@ -78,6 +78,24 @@ input_execute_binding(struct terminal *term, enum binding_action action, term_spawn_new(term); break; + case BIND_ACTION_MINIMIZE: + xdg_toplevel_set_minimized(term->window->xdg_toplevel); + break; + + case BIND_ACTION_MAXIMIZE: + if (term->window->is_maximized) + xdg_toplevel_unset_maximized(term->window->xdg_toplevel); + else + xdg_toplevel_set_maximized(term->window->xdg_toplevel); + break; + + case BIND_ACTION_FULLSCREEN: + if (term->window->is_fullscreen) + xdg_toplevel_unset_fullscreen(term->window->xdg_toplevel); + else + xdg_toplevel_set_fullscreen(term->window->xdg_toplevel, NULL); + break; + case BIND_ACTION_COUNT: assert(false); break; diff --git a/wayland.h b/wayland.h index bf765f04..a824c21f 100644 --- a/wayland.h +++ b/wayland.h @@ -52,6 +52,9 @@ enum binding_action { BIND_ACTION_FONT_SIZE_DOWN, BIND_ACTION_FONT_SIZE_RESET, BIND_ACTION_SPAWN_TERMINAL, + BIND_ACTION_MINIMIZE, + BIND_ACTION_MAXIMIZE, + BIND_ACTION_FULLSCREEN, BIND_ACTION_COUNT, }; -- cgit v1.3 From 45384839f0e9627cd5b376b045e11c14277d40d0 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 12 Mar 2020 10:20:05 +0100 Subject: config/input: implement mouse bindings * New config section, "mouse-bindings", where bindings are defined on the form "action=BTN_ * pointer_button() handler now scans the bindings list instead of hardcoding primary-paste to BTN_MIDDLE. * The implementation handles single- double- and triple clicks in the bindings, but there is currently no way to define anything but a single-click binding in the configuration. --- config.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++---------- config.h | 2 +- doc/foot.5.scd | 12 ++++++++++++ footrc | 3 +++ input.c | 30 ++++++++++++++++++++--------- wayland.h | 6 ++++++ 6 files changed, 94 insertions(+), 20 deletions(-) (limited to 'doc') diff --git a/config.c b/config.c index 77b74227..7e1f8939 100644 --- a/config.c +++ b/config.c @@ -12,6 +12,7 @@ #include #include +#include #include #define LOG_MODULE "config" @@ -448,8 +449,9 @@ parse_section_csd(const char *key, const char *value, struct config *conf, } static bool -parse_section_key_bindings(const char *key, const char *value, struct config *conf, - const char *path, unsigned lineno) +parse_section_key_bindings( + const char *key, const char *value, struct config *conf, + const char *path, unsigned lineno) { for (enum binding_action action = 0; action < BIND_ACTION_COUNT; action++) { if (strcmp(key, binding_action_map[action]) != 0) @@ -459,7 +461,8 @@ parse_section_key_bindings(const char *key, const char *value, struct config *co struct xkb_keymap *keymap = xkb_keymap_new_from_names( ctx, &(struct xkb_rule_names){0}, XKB_KEYMAP_COMPILE_NO_FLAGS); - bool valid_combo = input_parse_key_binding_for_action(keymap, action, value, NULL); + bool valid_combo = input_parse_key_binding_for_action( + keymap, action, value, NULL); xkb_keymap_unref(keymap); xkb_context_unref(ctx); @@ -479,6 +482,43 @@ parse_section_key_bindings(const char *key, const char *value, struct config *co } +static bool +parse_section_mouse_bindings( + const char *key, const char *value, struct config *conf, + const char *path, unsigned lineno) +{ + for (enum binding_action action = 0; action < BIND_ACTION_COUNT; action++) { + if (strcmp(key, binding_action_map[action]) != 0) + continue; + + const char *map[] = { + [BTN_LEFT] = "BTN_LEFT", + [BTN_RIGHT] = "BTN_RIGHT", + [BTN_MIDDLE] = "BTN_MIDDLE", + [BTN_SIDE] = "BTN_SIDE", + [BTN_EXTRA] = "BTN_EXTRA", + [BTN_FORWARD] = "BTN_FORWARD", + [BTN_BACK] = "BTN_BACK", + [BTN_TASK] = "BTN_TASK", + }; + + for (size_t i = 0; i < ALEN(map); i++) { + if (map[i] == NULL || strcmp(map[i], value) != 0) + continue; + + conf->bindings.mouse[action] = (struct mouse_binding){i, 1, action}; + return true; + } + + LOG_ERR("%s:%d: invalid mouse button: %s", path, lineno, value); + return false; + + } + + LOG_ERR("%s:%u: invalid key: %s", path, lineno, key); + return false; +} + static bool parse_config_file(FILE *f, struct config *conf, const char *path) { @@ -488,6 +528,7 @@ parse_config_file(FILE *f, struct config *conf, const char *path) SECTION_CURSOR, SECTION_CSD, SECTION_KEY_BINDINGS, + SECTION_MOUSE_BINDINGS, SECTION_COUNT, } section = SECTION_MAIN; @@ -500,11 +541,12 @@ parse_config_file(FILE *f, struct config *conf, const char *path) parser_fun_t fun; const char *name; } section_info[] = { - [SECTION_MAIN] = {&parse_section_main, "main"}, - [SECTION_COLORS] = {&parse_section_colors, "colors"}, - [SECTION_CURSOR] = {&parse_section_cursor, "cursor"}, - [SECTION_CSD] = {&parse_section_csd, "csd"}, - [SECTION_KEY_BINDINGS] = {&parse_section_key_bindings, "key-bindings"}, + [SECTION_MAIN] = {&parse_section_main, "main"}, + [SECTION_COLORS] = {&parse_section_colors, "colors"}, + [SECTION_CURSOR] = {&parse_section_cursor, "cursor"}, + [SECTION_CSD] = {&parse_section_csd, "csd"}, + [SECTION_KEY_BINDINGS] = {&parse_section_key_bindings, "key-bindings"}, + [SECTION_MOUSE_BINDINGS] = {&parse_section_mouse_bindings, "mouse-bindings"}, }; static_assert(ALEN(section_info) == SECTION_COUNT, "section info array size mismatch"); @@ -699,7 +741,7 @@ config_load(struct config *conf, const char *conf_path) [BIND_ACTION_SPAWN_TERMINAL] = strdup("Control+Shift+Return"), }, .mouse = { - [BIND_ACTION_PRIMARY_PASTE] = strdup("BTN_MIDDLE"), + [BIND_ACTION_PRIMARY_PASTE] = {BTN_MIDDLE, 1, BIND_ACTION_PRIMARY_PASTE}, }, .search = { }, @@ -760,7 +802,6 @@ config_free(struct config conf) for (size_t i = 0; i < BIND_ACTION_COUNT; i++) { free(conf.bindings.key[i]); - free(conf.bindings.mouse[i]); free(conf.bindings.search[i]); } } diff --git a/config.h b/config.h index af078b00..bf205305 100644 --- a/config.h +++ b/config.h @@ -39,7 +39,7 @@ struct config { struct { /* Bindings for "normal" mode */ char *key[BIND_ACTION_COUNT]; - char *mouse[BIND_ACTION_COUNT]; + struct mouse_binding mouse[BIND_ACTION_COUNT]; /* * Special modes diff --git a/doc/foot.5.scd b/doc/foot.5.scd index 5c8becdf..dbbcc52d 100644 --- a/doc/foot.5.scd +++ b/doc/foot.5.scd @@ -203,6 +203,18 @@ Note that _Alt_ is usually called *Mod1*. *fullscreen* Toggles the fullscreen state. Default: _not bound_. +# SECTION: mouse-bindings + +This section lets you override the default mouse bindings. + +The general format is *action*=*BTN\_*, where *BTN\_* is +the name of the event code (e.g. *BTN\_LEFT*, *BTN\_RIGHT*). You can +find the event names using *libinput debug-events*. + +*primary-paste* + Pastes from the _primary selection_. Default: _BTN_MIDDLE_. + + # FONT FORMAT The font is specified in FontConfig syntax. That is, a colon-separated diff --git a/footrc b/footrc index 468bc67d..73512474 100644 --- a/footrc +++ b/footrc @@ -56,3 +56,6 @@ # # minimize= # # maximize= # # fullscreen= + +[mouse-bindings] +# primary-paste=BTN_MIDDLE diff --git a/input.c b/input.c index 399d9d26..8fbb02cd 100644 --- a/input.c +++ b/input.c @@ -31,6 +31,8 @@ #include "terminal.h" #include "vt.h" +#define ALEN(v) (sizeof(v) / sizeof(v[0])) + void input_execute_binding(struct terminal *term, enum binding_action action, uint32_t serial) @@ -54,8 +56,7 @@ input_execute_binding(struct terminal *term, enum binding_action action, break; case BIND_ACTION_PRIMARY_PASTE: - LOG_ERR("unimplemented"); - assert(false); + selection_from_primary(term); break; case BIND_ACTION_SEARCH_START: @@ -321,7 +322,6 @@ keyboard_leave(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, static const struct key_data * keymap_data_for_sym(xkb_keysym_t sym, size_t *count) { -#define ALEN(a) (sizeof(a) / sizeof(a[0])) switch (sym) { case XKB_KEY_Escape: *count = ALEN(key_escape); return key_escape; case XKB_KEY_Return: *count = ALEN(key_return); return key_return; @@ -402,7 +402,6 @@ keymap_data_for_sym(xkb_keysym_t sym, size_t *count) case XKB_KEY_KP_9: *count = ALEN(key_kp_9); return key_kp_9; } - #undef ALEN return NULL; } @@ -1151,11 +1150,24 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer, selection_mark_row(term, wayl->mouse.row, serial); break; } - } else { - if (wayl->mouse.count == 1 && button == BTN_MIDDLE && - selection_enabled(term)) - { - selection_from_primary(term); + } + + else { + for (size_t i = 0; i < ALEN(wayl->conf->bindings.mouse); i++) { + const struct mouse_binding *binding = + &wayl->conf->bindings.mouse[i]; + + if (binding->button != button) { + /* Wrong button */ + continue; + } + + if (binding->count != wayl->mouse.count) { + /* Not correct click count */ + continue; + } + + input_execute_binding(term, binding->action, serial); } selection_cancel(term); } diff --git a/wayland.h b/wayland.h index a824c21f..2ddfdf87 100644 --- a/wayland.h +++ b/wayland.h @@ -65,6 +65,12 @@ struct key_binding { }; typedef tll(struct key_binding) key_binding_list_t; +struct mouse_binding { + uint32_t button; + int count; + enum binding_action action; +}; + struct kbd { struct xkb_context *xkb; struct xkb_keymap *xkb_keymap; -- cgit v1.3 From c58f9a9ef93fd3fd2be711906b8214a53665e45f Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 12 Mar 2020 10:46:27 +0100 Subject: config: mouse-bindings: verify button isn't already mapped A button may only be mapped to a single action. Detect when the user tried to map the same button to multiple actions and error out. To clear a binding (for example, to free up a button from the default bindings), one can set the action it is bound to to `NONE` (e.g. `primary-paste=NONE`). --- config.c | 26 +++++++++++++++++++++++++- doc/foot.5.scd | 14 ++++++++++---- input.c | 4 ++++ wayland.h | 1 + 4 files changed, 40 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/config.c b/config.c index 7e1f8939..ba216348 100644 --- a/config.c +++ b/config.c @@ -49,6 +49,7 @@ static const uint32_t default_bright[] = { }; static const char *binding_action_map[] = { + [BIND_ACTION_NONE] = NULL, [BIND_ACTION_SCROLLBACK_UP] = "scrollback-up", [BIND_ACTION_SCROLLBACK_DOWN] = "scrollback-down", [BIND_ACTION_CLIPBOARD_COPY] = "clipboard-copy", @@ -454,6 +455,9 @@ parse_section_key_bindings( const char *path, unsigned lineno) { for (enum binding_action action = 0; action < BIND_ACTION_COUNT; action++) { + if (binding_action_map[action] == NULL) + continue; + if (strcmp(key, binding_action_map[action]) != 0) continue; @@ -488,9 +492,17 @@ parse_section_mouse_bindings( const char *path, unsigned lineno) { for (enum binding_action action = 0; action < BIND_ACTION_COUNT; action++) { + if (binding_action_map[action] == NULL) + continue; + if (strcmp(key, binding_action_map[action]) != 0) continue; + if (strcmp(value, "NONE") == 0) { + conf->bindings.mouse[action] = (struct mouse_binding){0, 0, BIND_ACTION_NONE}; + return true; + } + const char *map[] = { [BTN_LEFT] = "BTN_LEFT", [BTN_RIGHT] = "BTN_RIGHT", @@ -506,7 +518,19 @@ parse_section_mouse_bindings( if (map[i] == NULL || strcmp(map[i], value) != 0) continue; - conf->bindings.mouse[action] = (struct mouse_binding){i, 1, action}; + const int count = 1; + + /* Make sure button isn't already mapped to another action */ + for (enum binding_action j = 0; j < BIND_ACTION_COUNT; j++) { + const struct mouse_binding *collision = &conf->bindings.mouse[j]; + if (collision->button == i && collision->count == count) { + LOG_ERR("%s:%d: %s already mapped to %s", path, lineno, + value, binding_action_map[collision->action]); + return false; + } + } + + conf->bindings.mouse[action] = (struct mouse_binding){i, count, action}; return true; } diff --git a/doc/foot.5.scd b/doc/foot.5.scd index dbbcc52d..457d053b 100644 --- a/doc/foot.5.scd +++ b/doc/foot.5.scd @@ -151,15 +151,15 @@ component. This section lets you override the default key bindings. -The general format is *action*=*combo1*...*comboN*. That is, each +The general format is _action_=_combo1_..._comboN_. That is, each action may have one or more key combinations, space separated. Each -combination is on the form *mod1*+*mod2*+*key*. The names of the +combination is on the form _mod1_+_mod2_+_key_. The names of the modifiers and the key *must* be a valid XKB key name. Note that if *Shift* is one of the modifiers, the _key_ *must* be in upper case. -Note that _Alt_ is usually called *Mod1*. +Note that *Alt* is usually called *Mod1*. *scrollback-up* Scrolls up/back in history. Default: _Shift+Page_Up_. @@ -207,10 +207,16 @@ Note that _Alt_ is usually called *Mod1*. This section lets you override the default mouse bindings. -The general format is *action*=*BTN\_*, where *BTN\_* is +The general format is _action_=_BTN\__, where _BTN\__ is the name of the event code (e.g. *BTN\_LEFT*, *BTN\_RIGHT*). You can find the event names using *libinput debug-events*. +A button can only be mapped to *one* action. Lets say you want to bind +*BTN\_MIDDLE* to *fullscreen*. Since *BTN\_MIDDLE* is the default +binding for *primary-paste*, you first need to unmap the default +binding. This can be done by setting _action_=*NONE*; +e.g. *primary-paste*=*NONE*. + *primary-paste* Pastes from the _primary selection_. Default: _BTN_MIDDLE_. diff --git a/input.c b/input.c index 8fbb02cd..1c80dd8b 100644 --- a/input.c +++ b/input.c @@ -38,6 +38,9 @@ input_execute_binding(struct terminal *term, enum binding_action action, uint32_t serial) { switch (action) { + case BIND_ACTION_NONE: + break; + case BIND_ACTION_SCROLLBACK_UP: cmd_scrollback_up(term, term->rows); break; @@ -1168,6 +1171,7 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer, } input_execute_binding(term, binding->action, serial); + break; } selection_cancel(term); } diff --git a/wayland.h b/wayland.h index 2ddfdf87..b8b91c00 100644 --- a/wayland.h +++ b/wayland.h @@ -42,6 +42,7 @@ struct monitor { }; enum binding_action { + BIND_ACTION_NONE, BIND_ACTION_SCROLLBACK_UP, BIND_ACTION_SCROLLBACK_DOWN, BIND_ACTION_CLIPBOARD_COPY, -- cgit v1.3 From 5cbd0527d703b2013b175d371de6c81aa7792863 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 12 Mar 2020 17:16:35 +0100 Subject: config: key-bindings: verify key combo isn't already mapped to another action --- config.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++----------- doc/foot.5.scd | 6 ++++++ 2 files changed, 53 insertions(+), 11 deletions(-) (limited to 'doc') diff --git a/config.c b/config.c index ba216348..bd237604 100644 --- a/config.c +++ b/config.c @@ -449,6 +449,47 @@ parse_section_csd(const char *key, const char *value, struct config *conf, return true; } +static bool +verify_key_combo(const struct config *conf, const char *combo, const char *path, unsigned lineno) +{ + for (enum binding_action action = 0; action < BIND_ACTION_COUNT; action++) { + if (conf->bindings.key[action] == NULL) + continue; + + char *copy = strdup(conf->bindings.key[action]); + + for (char *save = NULL, *collision = strtok_r(copy, " ", &save); + collision != NULL; + collision = strtok_r(NULL, " ", &save)) + { + if (strcmp(combo, collision) == 0) { + LOG_ERR("%s:%d: %s already mapped to %s", path, lineno, combo, binding_action_map[action]); + free(copy); + return false; + } + } + + free(copy); + } + + struct xkb_context *ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS); + struct xkb_keymap *keymap = xkb_keymap_new_from_names( + ctx, &(struct xkb_rule_names){0}, XKB_KEYMAP_COMPILE_NO_FLAGS); + + bool valid_combo = input_parse_key_binding_for_action( + keymap, BIND_ACTION_NONE, combo, NULL); + + xkb_keymap_unref(keymap); + xkb_context_unref(ctx); + + if (!valid_combo) { + LOG_ERR("%s:%d: invalid key combination: %s", path, lineno, combo); + return false; + } + + return true; +} + static bool parse_section_key_bindings( const char *key, const char *value, struct config *conf, @@ -461,18 +502,13 @@ parse_section_key_bindings( if (strcmp(key, binding_action_map[action]) != 0) continue; - struct xkb_context *ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS); - struct xkb_keymap *keymap = xkb_keymap_new_from_names( - ctx, &(struct xkb_rule_names){0}, XKB_KEYMAP_COMPILE_NO_FLAGS); - - bool valid_combo = input_parse_key_binding_for_action( - keymap, action, value, NULL); - - xkb_keymap_unref(keymap); - xkb_context_unref(ctx); + if (strcmp(value, "NONE") == 0) { + free(conf->bindings.key[action]); + conf->bindings.key[action] = NULL; + return true; + } - if (!valid_combo) { - LOG_ERR("%s:%d: invalid key combination: %s", path, lineno, value); + if (!verify_key_combo(conf, value, path, lineno)) { return false; } diff --git a/doc/foot.5.scd b/doc/foot.5.scd index 457d053b..d01a3d6e 100644 --- a/doc/foot.5.scd +++ b/doc/foot.5.scd @@ -161,6 +161,12 @@ upper case. Note that *Alt* is usually called *Mod1*. +A key combination can only be mapped to *one* action. Lets say you +want to bind *Control*+*Shift*+*R* to *fullscreen*. Since this is the +default shortcut for *search-start*, you first need to unmap the +default binding. This can be done by setting _action_=*NONE*; +e.g. *search-start*=*NONE*. + *scrollback-up* Scrolls up/back in history. Default: _Shift+Page_Up_. -- cgit v1.3 From 0e00b6fa159956354ea9598328c13c4e201c20e5 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 12 Mar 2020 17:21:48 +0100 Subject: doc/foot.5: add an example that uses Shift --- doc/foot.5.scd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/foot.5.scd b/doc/foot.5.scd index d01a3d6e..8c6fb2fe 100644 --- a/doc/foot.5.scd +++ b/doc/foot.5.scd @@ -157,7 +157,8 @@ combination is on the form _mod1_+_mod2_+_key_. The names of the modifiers and the key *must* be a valid XKB key name. Note that if *Shift* is one of the modifiers, the _key_ *must* be in -upper case. +upper case. For example, *Control*+*Shift*+*v* will never trigger - +*Control*+*Shift*+*V* is the correct way to write it. Note that *Alt* is usually called *Mod1*. -- cgit v1.3 From a7b90b514cc9ade0ded93172d9b88ad21a04a55b Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 12 Mar 2020 17:24:54 +0100 Subject: doc/foot.5: mention that *all* actions can be used in mouse bindings --- doc/foot.5.scd | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/foot.5.scd b/doc/foot.5.scd index 8c6fb2fe..f504fba5 100644 --- a/doc/foot.5.scd +++ b/doc/foot.5.scd @@ -224,6 +224,8 @@ binding for *primary-paste*, you first need to unmap the default binding. This can be done by setting _action_=*NONE*; e.g. *primary-paste*=*NONE*. +All actions listed under *key-bindings* can be user here as well. + *primary-paste* Pastes from the _primary selection_. Default: _BTN_MIDDLE_. -- cgit v1.3