Skip to content

Commit

Permalink
GUACAMOLE-1943: Add ctrl+arrows/ctrl+backspace/ctrl+suppr/ctrl+up dow…
Browse files Browse the repository at this point in the history
…n shortcuts
  • Loading branch information
corentin-soriano committed Jun 6, 2024
1 parent 7d004ce commit 4648128
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/terminal/terminal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1619,6 +1619,18 @@ static int __guac_terminal_send_key(guac_terminal* term, int keysym, int pressed
return 0;
}

/* Up */
if (keysym == 0xFF52 || keysym == 0xFF97) {
guac_terminal_scroll_display_up(term, 1);
return 0;
}

/* Down */
if (keysym == 0xFF54 || keysym == 0xFF99) {
guac_terminal_scroll_display_down(term, 1);
return 0;
}

}

/* Reset scroll */
Expand Down Expand Up @@ -1654,6 +1666,22 @@ static int __guac_terminal_send_key(guac_terminal* term, int keysym, int pressed
else if (keysym >= '3' && keysym <= '7')
data = (char) (keysym - '3' + 0x1B);

/* CTRL+Left: return to previous word */
else if (keysym == 0xFF51 || keysym == 0xFF96)
return guac_terminal_send_string(term, "\033[1;5D");

/* CTRL+Right: go to next word */
else if (keysym == 0xFF53 || keysym == 0xFF98)
return guac_terminal_send_string(term, "\033[1;5C");

/* CTRL+Backspace: remove word (map to CTRL+w) */
else if (keysym == 0xFF08)
data = (char) 23;

/* CTRL+Supr: remove word to right */
else if (keysym == 0xFFFF)
return guac_terminal_send_string(term, "\033D");

/* Otherwise ignore */
else
return 0;
Expand Down

0 comments on commit 4648128

Please sign in to comment.