2004-12-03 22:17:46 +03:00
|
|
|
#ifndef MC_KEY_H
|
|
|
|
#define MC_KEY_H
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
void init_key (void);
|
|
|
|
void init_key_input_fd (void);
|
|
|
|
void done_key (void);
|
1999-04-21 23:18:31 +04:00
|
|
|
|
2003-10-26 07:03:07 +03:00
|
|
|
struct Gpm_Event;
|
|
|
|
int get_event (struct Gpm_Event *event, int redo_event, int block);
|
1998-02-27 07:54:42 +03:00
|
|
|
int is_idle (void);
|
|
|
|
|
|
|
|
int mi_getch (void);
|
|
|
|
/* Possible return values from get_event: */
|
|
|
|
#define EV_MOUSE -2
|
|
|
|
#define EV_NONE -1
|
|
|
|
|
2002-12-21 10:34:49 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Internal representation of the key modifiers. It is used in the
|
2002-12-21 11:43:15 +03:00
|
|
|
* sequence tables and the keycodes in the mc sources.
|
2002-12-21 10:34:49 +03:00
|
|
|
*/
|
|
|
|
#define KEY_M_SHIFT 0x1000
|
|
|
|
#define KEY_M_ALT 0x2000
|
|
|
|
#define KEY_M_CTRL 0x4000
|
|
|
|
#define KEY_M_MASK 0x7000
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
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);
|
|
|
|
|
2002-12-23 12:46:28 +03:00
|
|
|
#define XCTRL(x) (KEY_M_CTRL | ((x) & 31))
|
|
|
|
#define ALT(x) (KEY_M_ALT | (unsigned int)(x))
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
/* To define sequences and return codes */
|
|
|
|
#define MCKEY_NOACTION 0
|
|
|
|
#define MCKEY_ESCAPE 1
|
|
|
|
|
|
|
|
/* Return code for the mouse sequence */
|
|
|
|
#define MCKEY_MOUSE -2
|
|
|
|
|
2004-08-29 20:42:40 +04:00
|
|
|
int define_sequence (int code, const char *seq, int action);
|
1998-02-27 07:54:42 +03:00
|
|
|
|
1998-05-20 06:19:17 +04:00
|
|
|
/* internally used in key.c, defined in keyxtra.c */
|
|
|
|
void load_xtra_key_defines (void);
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
/* Learn a single key */
|
|
|
|
char *learn_key (void);
|
|
|
|
|
|
|
|
/* Returns a key code (interpreted) */
|
|
|
|
int get_key_code (int nodelay);
|
|
|
|
|
2002-07-31 04:35:06 +04:00
|
|
|
typedef const struct {
|
1998-02-27 07:54:42 +03:00
|
|
|
int code;
|
2004-08-30 03:27:40 +04:00
|
|
|
const char *name;
|
|
|
|
const char *longname;
|
1998-02-27 07:54:42 +03:00
|
|
|
} key_code_name_t;
|
|
|
|
|
|
|
|
extern key_code_name_t key_name_conv_tab [];
|
|
|
|
|
1998-04-01 02:36:24 +04:00
|
|
|
/* Set keypad mode (xterm and linux console only) */
|
2001-11-15 02:20:37 +03:00
|
|
|
void numeric_keypad_mode (void);
|
|
|
|
void application_keypad_mode (void);
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2004-12-03 22:17:46 +03:00
|
|
|
#endif
|