+2003-07-24 Stephane Carrez <stcarrez@nerim.fr>
+
+ * tui.c (tui_rl_other_window): New function to switch the TUI active
+ window and give focus to a next window.
+ (tui_initialize_readline): Bind it to c-x o.
+ (tui_rl_next_keymap): Activate TUI mode when entering SingleKey mode.
+
2003-07-23 Stephane Carrez <stcarrez@nerim.fr>
* tui.c (tui_enable): Call tuiRefreshAll to make sure the window
#include "tuiStack.h"
#include "tuiWin.h"
#include "tuiSourceWin.h"
+#include "tuiDataWin.h"
#include "readline/readline.h"
#include "target.h"
#include "frame.h"
return 0;
}
+/* TUI readline command.
+ Switch the active window to give the focus to a next window. */
+static int
+tui_rl_other_window (int count, int key)
+{
+ TuiWinInfoPtr winInfo;
+
+ if (!tui_active)
+ tui_rl_switch_mode (0/*notused*/, 0/*notused*/);
+
+ winInfo = tuiNextWin (tuiWinWithFocus ());
+ if (winInfo)
+ {
+ tuiSetWinFocusTo (winInfo);
+ if (dataWin && dataWin->generic.isVisible)
+ tuiRefreshDataWin ();
+ keypad (cmdWin->generic.handle, (winInfo != cmdWin));
+ }
+ return 0;
+}
+
/* TUI readline command.
Execute the gdb command bound to the specified key. */
static int
static int
tui_rl_next_keymap (int notused1, int notused2)
{
+ if (!tui_active)
+ tui_rl_switch_mode (0/*notused*/, 0/*notused*/);
+
tui_set_key_mode (tui_current_key_mode == tui_command_mode
? tui_single_key_mode : tui_command_mode);
return 0;
rl_bind_key_in_map ('1', tui_rl_delete_other_windows, tui_ctlx_keymap);
rl_bind_key_in_map ('2', tui_rl_change_windows, emacs_ctlx_keymap);
rl_bind_key_in_map ('2', tui_rl_change_windows, tui_ctlx_keymap);
+ rl_bind_key_in_map ('o', tui_rl_other_window, emacs_ctlx_keymap);
+ rl_bind_key_in_map ('o', tui_rl_other_window, tui_ctlx_keymap);
rl_bind_key_in_map ('q', tui_rl_next_keymap, tui_keymap);
rl_bind_key_in_map ('s', tui_rl_next_keymap, emacs_ctlx_keymap);
rl_bind_key_in_map ('s', tui_rl_next_keymap, tui_ctlx_keymap);