Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1655 | giacomo | 1 | /* ------------------ */ |
2 | /* Keyboard handler */ |
||
3 | /* ------------------ */ |
||
4 | |||
5 | #include <drivers/keyb.h> |
||
6 | #include "include/keyfunct.h" |
||
7 | |||
8 | void keyb_h() { |
||
9 | KEY_EVT k; |
||
10 | keyb_set_map(itaMap); |
||
11 | /* Exit keys: ALT-X, ENTER */ |
||
12 | k.flag = ALTL_BIT; |
||
13 | k.scan = KEY_X; |
||
14 | k.ascii = 'x'; |
||
15 | keyb_hook(k, endfun); |
||
16 | k.flag = ALTR_BIT; |
||
17 | k.scan = KEY_X; |
||
18 | k.ascii = 'x'; |
||
19 | keyb_hook(k, endfun); |
||
20 | k.flag = 0; |
||
21 | k.scan = KEY_ENT; |
||
22 | k.ascii = 13; |
||
23 | keyb_hook(k, endfun); |
||
24 | /* Create HARD cars */ |
||
25 | k.flag = 0; |
||
26 | k.scan = KEY_C; |
||
27 | k.ascii = 'c'; |
||
28 | keyb_hook(k, h_car_create); |
||
29 | /* kill hard cars*/ |
||
30 | k.flag = 0; |
||
31 | k.scan = KEY_K; |
||
32 | k.ascii = 'k'; |
||
33 | keyb_hook(k, h_car_kill); |
||
34 | //refresh map |
||
35 | k.flag=0; |
||
36 | k.scan = KEY_R; |
||
37 | k.ascii = 'r'; |
||
38 | keyb_hook(k, refresh); |
||
39 | //create soft cars |
||
40 | k.flag=0; |
||
41 | k.scan = KEY_S; |
||
42 | k.ascii = 's'; |
||
43 | keyb_hook(k, s_car_create); |
||
44 | //toggle sensors |
||
45 | k.flag=0; |
||
46 | k.scan = KEY_D; |
||
47 | k.ascii = 'd'; |
||
48 | keyb_hook(k, sensor_switch); |
||
49 | } |