Noor-glyp commented on a change in pull request #350:
URL: https://github.com/apache/guacamole-server/pull/350#discussion_r745338834
##########
File path: src/terminal/terminal.c
##########
@@ -1590,17 +1590,129 @@ static int __guac_terminal_send_key(guac_terminal*
term, int keysym, int pressed
if (keysym == 0xFF54 || keysym == 0xFF99) return
guac_terminal_send_string(term, "\x1B[B"); /* Down */
}
+ /* Shift + Function keys. */
+ if (term->mod_shift) {
+ if (keysym == 0xFFBE || keysym == 0xFF91) return
guac_terminal_send_string(term, "\x1B[1;2P"); /* F1 */
+ if (keysym == 0xFFBF || keysym == 0xFF92) return
guac_terminal_send_string(term, "\x1B[1;2Q"); /* F2 */
+ if (keysym == 0xFFC0 || keysym == 0xFF93) return
guac_terminal_send_string(term, "\x1B[1;2R"); /* F3 */
+ if (keysym == 0xFFC1 || keysym == 0xFF94) return
guac_terminal_send_string(term, "\x1B[1;2S"); /* F4 */
+ if (keysym == 0xFFC2) return guac_terminal_send_string(term,
"\x1B[15;2~"); /* F5 */
+ if (keysym == 0xFFC3) return guac_terminal_send_string(term,
"\x1B[17;2~"); /* F6 */
+ if (keysym == 0xFFC4) return guac_terminal_send_string(term,
"\x1B[18;2~"); /* F7 */
+ if (keysym == 0xFFC5) return guac_terminal_send_string(term,
"\x1B[19;2~"); /* F8 */
+ if (keysym == 0xFFC6) return guac_terminal_send_string(term,
"\x1B[20;2~"); /* F9 */
+ if (keysym == 0xFFC7) return guac_terminal_send_string(term,
"\x1B[21;2~"); /* F10 */
+ if (keysym == 0xFFC8) return guac_terminal_send_string(term,
"\x1B[23;2~"); /* F11 */
+ if (keysym == 0xFFC9) return guac_terminal_send_string(term,
"\x1B[24;2~"); /* F12 */
+ }
+
+ /* Alt + Function keys. */
+ if (term->mod_alt) {
+ if (keysym == 0xFFBE || keysym == 0xFF91) return
guac_terminal_send_string(term, "\x1B[1;3P"); /* F1 */
+ if (keysym == 0xFFBF || keysym == 0xFF92) return
guac_terminal_send_string(term, "\x1B[1;3Q"); /* F2 */
+ if (keysym == 0xFFC0 || keysym == 0xFF93) return
guac_terminal_send_string(term, "\x1B[1;3R"); /* F3 */
+ if (keysym == 0xFFC1 || keysym == 0xFF94) return
guac_terminal_send_string(term, "\x1B[1;3S"); /* F4 */
+ if (keysym == 0xFFC2) return guac_terminal_send_string(term,
"\x1B[15;3~"); /* F5 */
+ if (keysym == 0xFFC3) return guac_terminal_send_string(term,
"\x1B[17;3~"); /* F6 */
+ if (keysym == 0xFFC4) return guac_terminal_send_string(term,
"\x1B[18;3~"); /* F7 */
+ if (keysym == 0xFFC5) return guac_terminal_send_string(term,
"\x1B[19;3~"); /* F8 */
+ if (keysym == 0xFFC6) return guac_terminal_send_string(term,
"\x1B[20;3~"); /* F9 */
+ if (keysym == 0xFFC7) return guac_terminal_send_string(term,
"\x1B[21;3~"); /* F10 */
+ if (keysym == 0xFFC8) return guac_terminal_send_string(term,
"\x1B[23;3~"); /* F11 */
+ if (keysym == 0xFFC9) return guac_terminal_send_string(term,
"\x1B[24;3~"); /* F12 */
+ }
+
+ /* Shift + Alt + Function keys. */
+ if(term->mod_shift && term->mod_alt){
Review comment:
Sorry about that, I had done that while testing at my machine but forgot
to commit. Fixed the formatting issues to. Like added `if (term->mod_alt &&
term->mod_ctrl) { ` also the functions sequence are
`Ctrl+Alt+Shift -> Fn key'
'Shift+Alt -> Fn key'
'Shift+Ctrl -> Fn key'
'Alt+Ctrl -> Fn key'
'Shift -> Fn key'
'Alt -> Fn key'
'Ctrl -> Fn key`
Also before proceeding with this approach I searched for a possible case
scenario for this but couldn't what we can do is, we have this sequence
'F1' to 'F4' P to S. Then 15 to 21 for 'F5' to 'F10' and 23 24 for 'F11' and
'F12'. And for different combinations [..;2 ,..., ..;8 is added. We can
generate these sequence/strings and send them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]