diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-10-24 09:49:37 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-10-27 15:07:26 +0000 |
| commit | bcea929c94cc8f8da8f29e52c17b09824a252318 (patch) | |
| tree | 0d7907320caf3f1002bbfed2523d08c9c6ff866e | |
| parent | doc: fix a typo (diff) | |
config: add [key-bindings].noop action
Key combinations assigned to this action will not be sent to the
application.
Closes #765
| -rw-r--r-- | CHANGELOG.md | 5 | ||||
| -rw-r--r-- | config.c | 1 | ||||
| -rw-r--r-- | doc/foot.ini.5.scd | 12 | ||||
| -rw-r--r-- | foot.ini | 1 | ||||
| -rw-r--r-- | input.c | 3 | ||||
| -rw-r--r-- | wayland.h | 1 |
6 files changed, 18 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b1526a04..ff51423a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,8 +38,11 @@ * `notify-focus-inhibit` boolean option, which can be used to control whether desktop notifications should be inhibited when the terminal has keyboard focus -* `colors.scrollback-indicator` color-pair option, which specifies +* `[colors].scrollback-indicator` color-pair option, which specifies foreground and background colors for the scrollback indicator. +* `[key-bindings].noop` action. Key combinations assigned to this + action will not be sent to the application + (https://codeberg.org/dnkl/foot/issues/765). ### Changed @@ -84,6 +84,7 @@ static const uint32_t default_color_table[256] = { static const char *const binding_action_map[] = { [BIND_ACTION_NONE] = NULL, + [BIND_ACTION_NOOP] = "noop", [BIND_ACTION_SCROLLBACK_UP_PAGE] = "scrollback-up-page", [BIND_ACTION_SCROLLBACK_UP_HALF_PAGE] = "scrollback-up-half-page", [BIND_ACTION_SCROLLBACK_UP_LINE] = "scrollback-up-line", diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd index 7a8ce173..0eba49dd 100644 --- a/doc/foot.ini.5.scd +++ b/doc/foot.ini.5.scd @@ -606,24 +606,28 @@ 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*. +*noop* + All key combinations listed here will not be sent to the + application. Default: _not bound_. + *scrollback-up-page* Scrolls up/back one page in history. Default: _Shift+Page\_Up_. *scrollback-up-half-page* - Scrolls up/back half of a page in history. Default: _not set_. + Scrolls up/back half of a page in history. Default: _not bound_. *scrollback-up-line* - Scrolls up/back a single line in history. Default: _not set_. + Scrolls up/back a single line in history. Default: _not bound_. *scrollback-down-page* Scroll down/forward one page in history. Default: _Shift+Page\_Down_. *scrollback-down-half-page* - Scroll down/forward half of a page in history. Default: _not set_. + Scroll down/forward half of a page in history. Default: _not bound_. *scrollback-down-line* - Scroll down/forward a single line in history. Default: _not set_. + Scroll down/forward a single line in history. Default: _not bound_. *clipboard-copy* Copies the current selection into the _clipboard_. Default: _Control+Shift+c_. @@ -127,6 +127,7 @@ # pipe-selected=[xargs -r firefox] none # show-urls-launch=Control+Shift+u # show-urls-copy=none +# noop=none [search-bindings] # cancel=Control+g Control+c Escape @@ -87,6 +87,9 @@ execute_binding(struct seat *seat, struct terminal *term, case BIND_ACTION_NONE: return true; + case BIND_ACTION_NOOP: + return true; + case BIND_ACTION_SCROLLBACK_UP_PAGE: if (term->grid == &term->normal) { cmd_scrollback_up(term, term->rows); @@ -30,6 +30,7 @@ struct terminal; enum bind_action_normal { BIND_ACTION_NONE, + BIND_ACTION_NOOP, BIND_ACTION_SCROLLBACK_UP_PAGE, BIND_ACTION_SCROLLBACK_UP_HALF_PAGE, BIND_ACTION_SCROLLBACK_UP_LINE, |
