1 /* Specific command window processing.
3 Copyright 1998, 1999, 2000, 2001, 2002, 2003 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. */
41 /*****************************************
42 ** STATIC LOCAL FUNCTIONS FORWARD DECLS **
43 ******************************************/
47 /*****************************************
48 ** PUBLIC FUNCTIONS **
49 ******************************************/
52 ** tuiDispatchCtrlChar().
53 ** Dispatch the correct tui function based upon the control character.
56 tuiDispatchCtrlChar (unsigned int ch
)
58 TuiWinInfoPtr winInfo
= tuiWinWithFocus ();
59 WINDOW
*w
= cmdWin
->generic
.handle
;
62 ** If the command window has the logical focus, or no-one does
63 ** assume it is the command window; in this case, pass the
64 ** character on through and do nothing here.
66 if (winInfo
== (TuiWinInfoPtr
) NULL
|| winInfo
== cmdWin
)
70 unsigned int c
= 0, chCopy
= ch
;
74 /* If this is an xterm, page next/prev keys aren't returned
75 ** by keypad as a single char, so we must handle them here.
76 ** Seems like a bug in the curses library?
78 term
= (char *) getenv ("TERM");
79 for (i
= 0; (term
&& term
[i
]); i
++)
80 term
[i
] = toupper (term
[i
]);
81 if ((strcmp (term
, "XTERM") == 0) && m_isStartSequence (ch
))
83 unsigned int pageCh
= 0, tmpChar
;
86 while (!m_isEndSequence (tmpChar
))
88 tmpChar
= (int) wgetch (w
);
97 else if (tmpChar
== 54)
110 tuiScrollForward (winInfo
, 0);
113 tuiScrollBackward (winInfo
, 0);
117 tuiScrollForward (winInfo
, 1);
121 tuiScrollBackward (winInfo
, 1);
124 tuiScrollLeft (winInfo
, 1);
127 tuiScrollRight (winInfo
, 1);
This page took 0.031927 seconds and 4 git commands to generate.