From 422d94fb46ad18e52f5385e416cd00cb7b4c2fc9 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 6 Feb 2022 19:36:44 +0100 Subject: wip: map key combos to custom text strings (including escapes) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- input.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'input.c') diff --git a/input.c b/input.c index e7b02fb8..26af0807 100644 --- a/input.c +++ b/input.c @@ -313,6 +313,11 @@ execute_binding(struct seat *seat, struct terminal *term, return true; } + case BIND_ACTION_TEXT_BINDING: + xassert(binding->aux->type == BINDING_AUX_TEXT); + term_to_slave(term, binding->aux->text.data, binding->aux->text.len); + return true; + case BIND_ACTION_SELECT_BEGIN: selection_start( term, seat->mouse.col, seat->mouse.row, SELECTION_CHAR_WISE, false); -- cgit v1.3