1 #ifndef EL__TERMINAL_KBD_H
2 #define EL__TERMINAL_KBD_H
6 struct term_event_keyboard
{
13 #define KBD_ENTER 0x100
17 #define KBD_LEFT 0x104
18 #define KBD_RIGHT 0x105
20 #define KBD_DOWN 0x107
23 #define KBD_HOME 0x10a
25 #define KBD_PAGE_UP 0x10c
26 #define KBD_PAGE_DOWN 0x10d
41 #define KBD_CTRL_C 0x200
43 #define KBD_MOD_NONE 0
44 #define KBD_MOD_SHIFT 1
45 #define KBD_MOD_CTRL 2
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
);
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);
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_); \