1 /* Specific command window processing.
2 Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
3 Contributed by Hewlett-Packard Company.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
30 /*****************************************
31 ** STATIC LOCAL FUNCTIONS FORWARD DECLS **
32 ******************************************/
36 /*****************************************
37 ** PUBLIC FUNCTIONS **
38 ******************************************/
41 ** tuiDispatchCtrlChar().
42 ** Dispatch the correct tui function based upon the control character.
45 tuiDispatchCtrlChar (unsigned int ch
)
47 TuiWinInfoPtr winInfo
= tuiWinWithFocus ();
48 WINDOW
*w
= cmdWin
->generic
.handle
;
51 ** If the command window has the logical focus, or no-one does
52 ** assume it is the command window; in this case, pass the
53 ** character on through and do nothing here.
55 if (winInfo
== (TuiWinInfoPtr
) NULL
|| winInfo
== cmdWin
)
59 unsigned int c
= 0, chCopy
= ch
;
63 /* If this is an xterm, page next/prev keys aren't returned
64 ** by keypad as a single char, so we must handle them here.
65 ** Seems like a bug in the curses library?
67 term
= (char *) getenv ("TERM");
68 for (i
= 0; (term
&& term
[i
]); i
++)
69 term
[i
] = toupper (term
[i
]);
70 if ((strcmp (term
, "XTERM") == 0) && m_isStartSequence (ch
))
72 unsigned int pageCh
= 0, tmpChar
;
75 while (!m_isEndSequence (tmpChar
))
77 tmpChar
= (int) wgetch (w
);
86 else if (tmpChar
== 54)
99 tuiScrollForward (winInfo
, 0);
102 tuiScrollBackward (winInfo
, 0);
106 tuiScrollForward (winInfo
, 1);
110 tuiScrollBackward (winInfo
, 1);
113 tuiScrollLeft (winInfo
, 1);
116 tuiScrollRight (winInfo
, 1);
This page took 0.031741 seconds and 4 git commands to generate.