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