3 * \brief Header: keyboard support routines
9 #include "lib/global.h" /* <glib.h> */
11 #include "tty.h" /* KEY_F macro */
13 gboolean
define_sequence (int code
, const char *seq
, int action
);
16 void init_key_input_fd (void);
19 long lookup_key (const char *name
, char **label
);
28 extern const key_code_name_t key_name_conv_tab
[];
30 extern int old_esc_mode_timeout
;
34 int tty_get_event (struct Gpm_Event
*event
, gboolean redo_event
, gboolean block
);
35 gboolean
is_idle (void);
38 /* Possible return values from tty_get_event: */
43 * Internal representation of the key modifiers. It is used in the
44 * sequence tables and the keycodes in the mc sources.
46 #define KEY_M_SHIFT 0x1000
47 #define KEY_M_ALT 0x2000
48 #define KEY_M_CTRL 0x4000
49 #define KEY_M_MASK 0x7000
51 extern int alternate_plus_minus
;
52 extern int double_click_speed
;
53 extern int old_esc_mode
;
54 extern int use_8th_bit_as_meta
;
55 extern int mou_auto_repeat
;
57 /* While waiting for input, the program can select on more than one file */
58 typedef int (*select_fn
) (int fd
, void *info
);
60 /* Channel manipulation */
61 void add_select_channel (int fd
, select_fn callback
, void *info
);
62 void delete_select_channel (int fd
);
63 void remove_select_channel (int fd
);
65 /* Activate/deactivate the channel checking */
66 void channels_up (void);
67 void channels_down (void);
69 #define XCTRL(x) (KEY_M_CTRL | ((x) & 0x1F))
70 #define ALT(x) (KEY_M_ALT | (unsigned int)(x))
72 static inline gboolean
75 return ((c
== ESC_CHAR
) || (c
== KEY_F (10)));
78 /* To define sequences and return codes */
79 #define MCKEY_NOACTION 0
80 #define MCKEY_ESCAPE 1
82 /* Return code for the mouse sequence */
83 #define MCKEY_MOUSE -2
86 /* internally used in key.c, defined in keyxtra.c */
87 void load_xtra_key_defines (void);
89 /* Learn a single key */
90 char *learn_key (void);
92 /* Returns a key code (interpreted) */
93 int get_key_code (int nodelay
);
95 /* Set keypad mode (xterm and linux console only) */
96 void numeric_keypad_mode (void);
97 void application_keypad_mode (void);