wip: map key combos to custom text strings (including escapes)

With this, it is now possible to map key combos to custom escapes. The
new bindings are defined in a new section, “text-bindings”, on the
form “string=key combo”.

The string can consist of printable characters, or \xNN style hex
digits:

  [text-bindings]
  abcd = Control+a
  \x1b[A = Control+b Control+c Control+d  # map ctrl+b/c/d to UP
This commit is contained in:
Daniel Eklöf 2022-02-06 19:36:44 +01:00
parent 8fa16f616c
commit 422d94fb46
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 132 additions and 4 deletions

View file

@ -54,6 +54,7 @@ enum bind_action_normal {
BIND_ACTION_PIPE_SELECTED,
BIND_ACTION_SHOW_URLS_COPY,
BIND_ACTION_SHOW_URLS_LAUNCH,
BIND_ACTION_TEXT_BINDING,
/* Mouse specific actions - i.e. they require a mouse coordinate */
BIND_ACTION_SELECT_BEGIN,
@ -119,7 +120,6 @@ struct key_binding {
};
const struct binding_aux *aux;
};
typedef tll(struct key_binding) key_binding_list_t;