Bug 997: Fix unlikely stack corruption in get_pasv_socket.
[elinks/elinks-j605.git] / src / terminal / kbd.h
blob958e1b3759904f4915dab3c4e742ff3c154bf67a
1 #ifndef EL__TERMINAL_KBD_H
2 #define EL__TERMINAL_KBD_H
4 struct itrm;
6 struct term_event_keyboard {
7 int key;
8 int modifier;
9 };
11 #define KBD_UNDEF -1
13 #define KBD_ENTER 0x100
14 #define KBD_BS 0x101
15 #define KBD_TAB 0x102
16 #define KBD_ESC 0x103
17 #define KBD_LEFT 0x104
18 #define KBD_RIGHT 0x105
19 #define KBD_UP 0x106
20 #define KBD_DOWN 0x107
21 #define KBD_INS 0x108
22 #define KBD_DEL 0x109
23 #define KBD_HOME 0x10a
24 #define KBD_END 0x10b
25 #define KBD_PAGE_UP 0x10c
26 #define KBD_PAGE_DOWN 0x10d
28 #define KBD_F1 0x120
29 #define KBD_F2 0x121
30 #define KBD_F3 0x122
31 #define KBD_F4 0x123
32 #define KBD_F5 0x124
33 #define KBD_F6 0x125
34 #define KBD_F7 0x126
35 #define KBD_F8 0x127
36 #define KBD_F9 0x128
37 #define KBD_F10 0x129
38 #define KBD_F11 0x12a
39 #define KBD_F12 0x12b
41 #define KBD_CTRL_C 0x200
43 #define KBD_MOD_NONE 0
44 #define KBD_MOD_SHIFT 1
45 #define KBD_MOD_CTRL 2
46 #define KBD_MOD_ALT 4
48 void
49 handle_trm(int std_in, int std_out, int sock_in, int sock_out, int ctl_in,
50 void *init_string, int init_len, int remote);
52 void itrm_queue_event(struct itrm *itrm, unsigned char *data, int len);
53 void block_itrm(int);
54 int unblock_itrm(int);
55 void free_all_itrms(void);
56 void resize_terminal(void);
57 void dispatch_special(unsigned char *);
58 void kbd_ctrl_c(void);
59 int is_blocked(void);
61 #define kbd_get_key(kbd_) ((kbd_)->key)
62 #define kbd_key_is(kbd_, key) (kbd_get_key(kbd_) == (key))
64 #define kbd_get_modifier(kbd_) ((kbd_)->modifier)
65 #define kbd_modifier_is(kbd_, mod) (kbd_get_modifier(kbd_) == (mod))
67 #define kbd_set(kbd_, key_, modifier_) do { \
68 (kbd_)->key = (key_); \
69 (kbd_)->modifier = (modifier_); \
70 } while (0)
73 #endif