1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

ctrl-shift-page-up/down to top or bottom of scrollback

Just a small patch, that I find really useful.
This commit is contained in:
Geoff Winkless 2017-11-03 14:31:10 +00:00 committed by Simon Tatham
parent 247d1b9b78
commit 81345e9a82
2 changed files with 27 additions and 0 deletions

View File

@ -965,6 +965,15 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
* Shift-PgUp and Shift-PgDn don't even generate keystrokes
* at all.
*/
if (event->keyval == GDK_KEY_Page_Up &&
((event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) ==
(GDK_CONTROL_MASK | GDK_SHIFT_MASK))) {
#ifdef KEY_EVENT_DIAGNOSTICS
debug((" - Ctrl-Shift-PgUp scroll\n"));
#endif
term_scroll(inst->term, 1, 0);
return TRUE;
}
if (event->keyval == GDK_KEY_Page_Up &&
(event->state & GDK_SHIFT_MASK)) {
#ifdef KEY_EVENT_DIAGNOSTICS
@ -981,6 +990,15 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
term_scroll(inst->term, 0, -1);
return TRUE;
}
if (event->keyval == GDK_KEY_Page_Down &&
((event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) ==
(GDK_CONTROL_MASK | GDK_SHIFT_MASK))) {
#ifdef KEY_EVENT_DIAGNOSTICS
debug((" - Ctrl-shift-PgDn scroll\n"));
#endif
term_scroll(inst->term, -1, 0);
return TRUE;
}
if (event->keyval == GDK_KEY_Page_Down &&
(event->state & GDK_SHIFT_MASK)) {
#ifdef KEY_EVENT_DIAGNOSTICS

View File

@ -4170,6 +4170,15 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
SendMessage(hwnd, WM_VSCROLL, SB_PAGEUP, 0);
return 0;
}
if (wParam == VK_PRIOR && shift_state == 3) { /* ctrl-shift-pageup */
SendMessage(hwnd, WM_VSCROLL, SB_TOP, 0);
return 0;
}
if (wParam == VK_NEXT && shift_state == 3) { /* ctrl-shift-pagedown */
SendMessage(hwnd, WM_VSCROLL, SB_BOTTOM, 0);
return 0;
}
if (wParam == VK_PRIOR && shift_state == 2) {
SendMessage(hwnd, WM_VSCROLL, SB_LINEUP, 0);
return 0;