1 /* Specific command window processing.
3 Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
6 Contributed by Hewlett-Packard Company.
8 This file is part of GDB.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. */
25 /* FIXME: cagney/2002-02-28: The GDB coding standard indicates that
26 "defs.h" should be included first. Unfortunatly some systems
27 (currently Debian GNU/Linux) include the <stdbool.h> via <curses.h>
28 and they clash with "bfd.h"'s definiton of true/false. The correct
29 fix is to remove true/false from "bfd.h", however, until that
30 happens, hack around it by including "config.h" and <curses.h>
50 /*****************************************
51 ** STATIC LOCAL FUNCTIONS FORWARD DECLS **
52 ******************************************/
56 /*****************************************
57 ** PUBLIC FUNCTIONS **
58 ******************************************/
61 ** tuiDispatchCtrlChar().
62 ** Dispatch the correct tui function based upon the control character.
65 tuiDispatchCtrlChar (unsigned int ch
)
67 TuiWinInfoPtr winInfo
= tuiWinWithFocus ();
68 WINDOW
*w
= cmdWin
->generic
.handle
;
71 ** If the command window has the logical focus, or no-one does
72 ** assume it is the command window; in this case, pass the
73 ** character on through and do nothing here.
75 if (winInfo
== (TuiWinInfoPtr
) NULL
|| winInfo
== cmdWin
)
79 unsigned int c
= 0, chCopy
= ch
;
83 /* If this is an xterm, page next/prev keys aren't returned
84 ** by keypad as a single char, so we must handle them here.
85 ** Seems like a bug in the curses library?
87 term
= (char *) getenv ("TERM");
88 for (i
= 0; (term
&& term
[i
]); i
++)
89 term
[i
] = toupper (term
[i
]);
90 if ((strcmp (term
, "XTERM") == 0) && m_isStartSequence (ch
))
92 unsigned int pageCh
= 0, tmpChar
;
95 while (!m_isEndSequence (tmpChar
))
97 tmpChar
= (int) wgetch (w
);
106 else if (tmpChar
== 54)
119 tuiScrollForward (winInfo
, 0);
122 tuiScrollBackward (winInfo
, 0);
126 tuiScrollForward (winInfo
, 1);
130 tuiScrollBackward (winInfo
, 1);
133 tuiScrollLeft (winInfo
, 1);
136 tuiScrollRight (winInfo
, 1);
This page took 0.032195 seconds and 4 git commands to generate.