diff options
Diffstat (limited to 'gdb/tui/tui-io.c')
-rw-r--r-- | gdb/tui/tui-io.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index cb27306..938f5ab 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -912,6 +912,57 @@ tui_initialize_io (void) #endif } +/* Dispatch the correct tui function based upon the control + character. */ +static unsigned int +tui_dispatch_ctrl_char (unsigned int ch) +{ + struct tui_win_info *win_info = tui_win_with_focus (); + + /* Handle the CTRL-L refresh for each window. */ + if (ch == '\f') + tui_refresh_all_win (); + + /* If no window has the focus, or if the focus window can't scroll, + just pass the character through. */ + if (win_info == NULL || !win_info->can_scroll ()) + return ch; + + switch (ch) + { + case KEY_NPAGE: + win_info->forward_scroll (0); + break; + case KEY_PPAGE: + win_info->backward_scroll (0); + break; + case KEY_DOWN: + case KEY_SF: + win_info->forward_scroll (1); + break; + case KEY_UP: + case KEY_SR: + win_info->backward_scroll (1); + break; + case KEY_RIGHT: + win_info->left_scroll (1); + break; + case KEY_LEFT: + win_info->right_scroll (1); + break; + case '\f': + break; + default: + /* We didn't recognize the character as a control character, so pass it + through. */ + return ch; + } + + /* We intercepted the control character, so return 0 (which readline + will interpret as a no-op). */ + return 0; +} + /* Get a character from the command window. This is called from the readline package. */ static int |