3 * \brief Header: keyboard support routines
9 #include "lib/global.h" /* <glib.h> */
10 #include "src/dialog.h" /* cb_ret_t */
12 #include "tty.h" /* KEY_F macro */
14 gboolean
define_sequence (int code
, const char *seq
, int action
);
17 void init_key_input_fd (void);
21 typedef void (*move_fn
) (void *data
, int param
);
22 cb_ret_t
check_movement_keys (int key
, int page_size
, void *data
,
23 move_fn backfn
, move_fn forfn
, move_fn topfn
, move_fn bottomfn
);
24 long lookup_key (const char *name
, char **label
);
33 extern const key_code_name_t key_name_conv_tab
[];
37 int tty_get_event (struct Gpm_Event
*event
, gboolean redo_event
, gboolean block
);
38 gboolean
is_idle (void);
41 /* Possible return values from tty_get_event: */
46 * Internal representation of the key modifiers. It is used in the
47 * sequence tables and the keycodes in the mc sources.
49 #define KEY_M_SHIFT 0x1000
50 #define KEY_M_ALT 0x2000
51 #define KEY_M_CTRL 0x4000
52 #define KEY_M_MASK 0x7000
54 extern int alternate_plus_minus
;
55 extern int double_click_speed
;
56 extern int old_esc_mode
;
57 extern int use_8th_bit_as_meta
;
58 extern int mou_auto_repeat
;
60 /* While waiting for input, the program can select on more than one file */
61 typedef int (*select_fn
) (int fd
, void *info
);
63 /* Channel manipulation */
64 void add_select_channel (int fd
, select_fn callback
, void *info
);
65 void delete_select_channel (int fd
);
66 void remove_select_channel (int fd
);
68 /* Activate/deactivate the channel checking */
69 void channels_up (void);
70 void channels_down (void);
72 #define XCTRL(x) (KEY_M_CTRL | ((x) & 0x1F))
73 #define ALT(x) (KEY_M_ALT | (unsigned int)(x))
75 static inline gboolean
78 return ((c
== ESC_CHAR
) || (c
== KEY_F (10)));
81 /* To define sequences and return codes */
82 #define MCKEY_NOACTION 0
83 #define MCKEY_ESCAPE 1
85 /* Return code for the mouse sequence */
86 #define MCKEY_MOUSE -2
89 /* internally used in key.c, defined in keyxtra.c */
90 void load_xtra_key_defines (void);
92 /* Learn a single key */
93 char *learn_key (void);
95 /* Returns a key code (interpreted) */
96 int get_key_code (int nodelay
);
98 /* Set keypad mode (xterm and linux console only) */
99 void numeric_keypad_mode (void);
100 void application_keypad_mode (void);
102 #endif /* MC_KEY_H */