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.
This commit is contained in:
fsub 2019-12-14 20:03:48 +01:00
parent b982371843
commit 3aab032797

View File

@ -640,7 +640,7 @@ Optional<Key> NCursesUI::get_next_key()
else else
return {}; return {};
} }
if (c < 0x40 or c > 0x7e) if (c != '$' and (c < 0x40 or c > 0x7e))
return {}; return {};
auto parse_mask = [](int mask) { auto parse_mask = [](int mask) {
@ -678,6 +678,13 @@ Optional<Key> NCursesUI::get_next_key()
switch (c) 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 'A': return masked_key(Key::Up);
case 'B': return masked_key(Key::Down); case 'B': return masked_key(Key::Down);
case 'C': return masked_key(Key::Right); case 'C': return masked_key(Key::Right);