fix key translation for option combos (GH bug #15)

This commit is contained in:
cy384 2022-02-24 19:36:19 -05:00
parent 5bed63fc83
commit 252bebd10a
1 changed files with 20 additions and 11 deletions

View File

@ -592,7 +592,15 @@ int handle_keypress(EventRecord* event)
}
else
{
// manually send an escape if we have alt option held
// if we have alt and the character would be printable ascii, use it
if (event->modifiers & optionKey && c >= 32 && c <= 126)
{
ssh_con.send_buffer[0] = c;
ssh_write(ssh_con.send_buffer, 1);
}
else
{
// otherwise manually send an escape if we have alt held
if (event->modifiers & optionKey)
{
ssh_con.send_buffer[0] = '\e';
@ -611,6 +619,7 @@ int handle_keypress(EventRecord* event)
}
}
}
}
return 0;
}