1
1
Document getch(), not xgetch().
Этот коммит содержится в:
Pavel Roskin 2002-09-03 22:22:01 +00:00
родитель 556f733f12
Коммит a62567eed9

Просмотреть файл

@ -26,7 +26,7 @@ o I work with the tags feature of GNU emacs. Run the make tags
o Try to keep the indenting style as it is currently. Normally if you o Try to keep the indenting style as it is currently. Normally if you
just created a new file with a different coding style, run the GNU just created a new file with a different coding style, run the GNU
indent program on it (remember to make a backup copy first) like indent program on it (remember to make a backup copy first) like
this: indent -kr -pcs filename.c this: indent -kr -i4 -psl -pcs filename.c
o This code is distributed under the GNU General Public License and o This code is distributed under the GNU General Public License and
Keep this in mind when adding code to the program. Keep this in mind when adding code to the program.
@ -59,23 +59,22 @@ o This code is distributed under the GNU General Public License and
* Input handling * Input handling
The routines for input handling on the Midnight Commander are: The routines for input handling on the Midnight Commander are:
xgetch, get_key_code, mi_getch and get_event. getch, get_key_code, mi_getch and get_event.
xgetch is an interface to the low level system input mechanism. It getch is an interface to the low level system input mechanism. It
does not deal with the mouse. does not deal with the mouse.
In the case of curses, this is a macro that translates to getch, on In the case of ncurses, this is a function implemented in the
BSD curses, it is an interface to x_getch. This routine on curses ncurses library that translates key sequences to key codes (\E[A to
translates key sequences to key codes (\E[A to something like something like KEY_UP and so on).
KEY_UP or whatever).
In the case of slang there is no such conversion, that's why we In the case of S-Lang there is no such conversion, that's why we
load a set of extra definitions. load a set of extra definitions.
The get_key_code routine converts the data from xgetch to the The get_key_code routine converts the data from getch to the
constants the Midnight Commander uses. constants the Midnight Commander uses.
In the case of slang, it will actually do all the jobs that getch In the case of S-Lang, it will actually do all the jobs that getch
does for curses. In the case of curses it patches a couple of does for curses. In the case of curses it patches a couple of
sequences that are not available on some terminal databases. This sequences that are not available on some terminal databases. This
routine is the one you want to use if you want a character without routine is the one you want to use if you want a character without
@ -90,7 +89,7 @@ convert it to useful constants.
mi_getch is just a wrapper around get_event that ignores all the mouse mi_getch is just a wrapper around get_event that ignores all the mouse
events. It's used only in a couple of places, this routine may return events. It's used only in a couple of places, this routine may return
ERR if no input is available (if you have set the nodelay option of ERR if no input is available (if you have set the nodelay option of
curses or slang with nodelay) or a character code if no such option is ncurses or S-Lang with nodelay) or a character code if no such option is
available. available.
* Mouse support. * Mouse support.
@ -101,7 +100,7 @@ dlg.c:run_dlg routine.
* ncurses * ncurses
We are dropping it in favor of slang, but we will still support it. We Althougt S-Lang is now used by default, we still support it ncurses. We
basically are using a small subset of ncurses because we want to be basically are using a small subset of ncurses because we want to be
compatible with Slang. compatible with Slang.