Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1664 | pj | 1 | /* ------------------ */ |
2 | /* Keyboard handler */ |
||
3 | /* ------------------ */ |
||
4 | |||
5 | #include "include/auto.h" |
||
6 | #include "include/const.h" |
||
7 | |||
8 | |||
9 | void keyb_handler() { |
||
10 | KEY_EVT k; |
||
11 | keyb_set_map(itaMap); |
||
12 | |||
13 | /* Exit keys: ESC */ |
||
14 | k.flag = 0; |
||
15 | k.scan = KEY_ESC; |
||
16 | k.ascii = 1; |
||
17 | keyb_hook(k, endfun); |
||
18 | |||
19 | |||
20 | /* moving the person ahead*/ |
||
21 | k.flag = 0; |
||
22 | k.scan = KEY_A; |
||
23 | k.ascii = 'a'; |
||
24 | keyb_hook(k,moveup); |
||
25 | |||
26 | /* moving the person ahead*/ |
||
27 | k.flag = 0; |
||
28 | k.scan = KEY_Z; |
||
29 | k.ascii = 'z'; |
||
30 | keyb_hook(k,movedown); |
||
31 | } |
||
32 | |||
33 | void endfun(KEY_EVT *k) |
||
34 | { |
||
35 | grx_close(); |
||
36 | cprintf("Ctrl-Brk pressed! Ending...\n"); |
||
37 | sys_end(); |
||
38 | } |
||
39 | |||
40 |