1
1
mc/src/key.h
Norbert Warmuth 3fd90ce83b This patch set adds a new feature to the text edtion (off by default).
`--with-tm-x-support'
     This option enables minimal X Window support in the text edition. It
     enables MC to query the status of the modifiers CONTROL and SHIFT
     when invoked in a terminal emulation under X11. That's necessary
     to recognice key combinations like C-HOME or S-Cursor key.


Wed Apr 21 20:37:32 1999  Norbert Warmuth  <nwarmuth@privat.circular.de>

* configure.in: New option --with-tm-x-support, use MCCFLAGS and
MCLIBS for build flags which are specific to the text edition.

* INSTALL: Added documentation for --with-tm-x-support

* src/Makefile.in: use MCCFLAGS and MCLIBS


Wed Apr 21 20:19:45 1999  Norbert Warmuth  <nwarmuth@privat.circular.de>

* src/key.c (get_modifier): Query the state of the modifier keys when
running inside a terminal emulation under X11.

* src/key.c (init_textmode_x11_support, done_textmode_x11_support): new
functions, only used in the text edition. Connect to and disconnect
from the X Server when DISPLAY is set.

* src/key.h: added prototypes for the new functions

* src/main.c (main): call (init|done)_textmode_x11_support
1999-04-21 19:18:31 +00:00

95 строки
2.2 KiB
C

#ifndef __KEY_H
#define __KEY_H
void init_key (void);
void init_key_input_fd (void);
void done_key (void);
void init_textmode_x11_support (void);
void done_textmode_x11_support (void);
int get_event (Gpm_Event *event, int redo_event, int block);
int is_idle (void);
int ctrl_pressed (void);
#ifndef PORT_HAS_GETCH
int mi_getch (void);
#endif
/* Possible return values from get_event: */
#define EV_MOUSE -2
#define EV_NONE -1
/* Used to get the modifier information */
/* Currently, it just works on the Linux console */
#ifdef _OS_NT
# ifndef SHIFT_PRESSED
# define SHIFT_PRESSED 0x0010
# endif
#else
# define SHIFT_PRESSED 1
#endif
#define ALTR_PRESSED 2
#define CONTROL_PRESSED 4
#define ALTL_PRESSED 8
int get_modifier (void);
extern int double_click_speed;
extern int old_esc_mode;
extern int irix_fn_keys;
extern int use_8th_bit_as_meta;
/* While waiting for input, the program can select on more than one file */
typedef int (*select_fn)(int fd, void *info);
/* Channel manipulation */
void add_select_channel (int fd, select_fn callback, void *info);
void delete_select_channel (int fd);
void remove_select_channel (int fd);
/* Activate/deactivate the channel checking */
void channels_up (void);
void channels_down (void);
/* Abort/Quit chars */
int is_abort_char (int c);
int is_quit_char (int c);
#define XCTRL(x) ((x) & 31)
#define ALT(x) (0x200 | (unsigned int)(x))
/* To define sequences and return codes */
#define MCKEY_NOACTION 0
#define MCKEY_ESCAPE 1
/* Return code for the mouse sequence */
#define MCKEY_MOUSE -2
void do_define_key (int code, char *strcap);
void define_sequence (int code, char *seq, int action);
/* internally used in key.c, defined in keyxtra.c */
void load_xtra_key_defines (void);
/* Learn a single key */
char *learn_key (void);
/* Returns a key code (interpreted) */
int get_key_code (int nodelay);
typedef struct {
int code;
char *name;
char *longname;
} key_code_name_t;
extern key_code_name_t key_name_conv_tab [];
extern int we_are_background;
/* Set keypad mode (xterm and linux console only) */
#ifndef HAVE_X
void numeric_keypad_mode (void);
void application_keypad_mode (void);
#endif
#endif /* __KEY_H */