Fix a regression in 0.20.0 that sent incorrect bytes for the F1-F4 keys in rmkx mode

Fixes #3586
This commit is contained in:
Kovid Goyal
2021-05-07 15:09:42 +05:30
parent dbf8580dc3
commit efb0f6f24a
3 changed files with 16 additions and 4 deletions

View File

@@ -185,6 +185,15 @@ encode_function_key(const KeyEvent *ev, char *output) {
}
if (!ev->mods.value) {
if (!ev->disambiguate && !ev->report_text && key_number == GLFW_FKEY_ESCAPE) SIMPLE("\x1b");
if (legacy_mode) {
switch(key_number) {
case GLFW_FKEY_F1: SIMPLE("\x1bOP");
case GLFW_FKEY_F2: SIMPLE("\x1bOQ");
case GLFW_FKEY_F3: SIMPLE("\x1bOR");
case GLFW_FKEY_F4: SIMPLE("\x1bOS");
default: break;
}
}
if (!ev->report_text) {
switch(key_number) {
case GLFW_FKEY_ENTER: SIMPLE("\r");