Merge branch 'modify-escape-key'

Closes #225
This commit is contained in:
Daniel Eklöf 2020-12-01 18:31:25 +01:00
commit c3201b9770
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 16 additions and 1 deletions

View file

@ -886,7 +886,13 @@ key_press_release(struct seat *seat, struct terminal *term, uint32_t serial,
keymap_mods |= seat->kbd.ctrl ? MOD_CTRL : MOD_NONE;
keymap_mods |= seat->kbd.meta ? MOD_META : MOD_NONE;
const struct key_data *keymap = keymap_lookup(seat, term, sym, keymap_mods);
const struct key_data *keymap;
if (sym == XKB_KEY_Escape && keymap_mods == MOD_NONE && term->modify_escape_key) {
static const struct key_data esc = {.seq = "\033[27;1;27~"};
keymap = &esc;
} else
keymap = keymap_lookup(seat, term, sym, keymap_mods);
if (keymap != NULL) {
term_to_slave(term, keymap->seq, strlen(keymap->seq));