From 3aab0327975330c0913ec00c2656955dddd4025d Mon Sep 17 00:00:00 2001 From: fsub <31548809+fsub@users.noreply.github.com> Date: Sat, 14 Dec 2019 20:03:48 +0100 Subject: [PATCH] Support rxvt style s-F11 and s-F12 Rxvt emits `\E[23$` and `\E[24$` for `F21` and `F22` (alias `s-F11` and `s-F12` provided that `ncurses_shift_function_key` is set to `10`), respectively. --- src/ncurses_ui.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index 8cf08d9d..8d9efc15 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -640,7 +640,7 @@ Optional NCursesUI::get_next_key() else return {}; } - if (c < 0x40 or c > 0x7e) + if (c != '$' and (c < 0x40 or c > 0x7e)) return {}; auto parse_mask = [](int mask) { @@ -678,6 +678,13 @@ Optional NCursesUI::get_next_key() switch (c) { + case '$': + switch (params[0]) + { + case 23: case 24: + return Key{Key::Modifiers::Shift, Key::F11 + params[0] - 23}; // rxvt style + } + return {}; case 'A': return masked_key(Key::Up); case 'B': return masked_key(Key::Down); case 'C': return masked_key(Key::Right);