Codepage messages related translated & other stuff...
[midnight-commander.git] / src / key.h
blob558f1c14b3f5980fd15ae0ab76431989f8e03484
1 #ifndef __KEY_H
2 #define __KEY_H
4 void init_key (void);
5 void init_key_input_fd (void);
6 void done_key (void);
8 int get_event (Gpm_Event *event, int redo_event, int block);
9 int is_idle (void);
10 int ctrl_pressed (void);
12 #ifndef PORT_HAS_GETCH
13 int mi_getch (void);
14 #endif
15 /* Possible return values from get_event: */
16 #define EV_MOUSE -2
17 #define EV_NONE -1
19 /* Used to get the modifier information */
20 /* Currently, it just works on the Linux console */
21 #ifdef _OS_NT
22 # ifndef SHIFT_PRESSED
23 # define SHIFT_PRESSED 0x0010
24 # endif
25 #else
26 # define SHIFT_PRESSED 1
27 #endif
28 #define ALTR_PRESSED 2
29 #define CONTROL_PRESSED 4
30 #define ALTL_PRESSED 8
31 int get_modifier (void);
33 extern int double_click_speed;
34 extern int old_esc_mode;
35 extern int irix_fn_keys;
36 extern int use_8th_bit_as_meta;
38 /* While waiting for input, the program can select on more than one file */
40 typedef int (*select_fn)(int fd, void *info);
42 /* Channel manipulation */
43 void add_select_channel (int fd, select_fn callback, void *info);
44 void delete_select_channel (int fd);
45 void remove_select_channel (int fd);
47 /* Activate/deactivate the channel checking */
48 void channels_up (void);
49 void channels_down (void);
51 /* Abort/Quit chars */
52 int is_abort_char (int c);
53 int is_quit_char (int c);
55 #define XCTRL(x) ((x) & 31)
56 #define ALT(x) (0x200 | (unsigned int)(x))
58 /* To define sequences and return codes */
59 #define MCKEY_NOACTION 0
60 #define MCKEY_ESCAPE 1
62 /* Return code for the mouse sequence */
63 #define MCKEY_MOUSE -2
65 void do_define_key (int code, char *strcap);
66 void define_sequence (int code, char *seq, int action);
68 /* internally used in key.c, defined in keyxtra.c */
69 void load_xtra_key_defines (void);
71 /* Learn a single key */
72 char *learn_key (void);
74 /* Returns a key code (interpreted) */
75 int get_key_code (int nodelay);
77 typedef struct {
78 int code;
79 char *name;
80 char *longname;
81 } key_code_name_t;
83 extern key_code_name_t key_name_conv_tab [];
84 extern int we_are_background;
86 /* Set keypad mode (xterm and linux console only) */
87 #ifndef HAVE_X
88 void numeric_keypad_mode (void);
89 void application_keypad_mode (void);
90 #endif
92 #endif /* __KEY_H */