-
Notifications
You must be signed in to change notification settings - Fork 0
/
user_input.h
42 lines (35 loc) · 961 Bytes
/
user_input.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef USER_INPUT_H
#define USER_INPUT_H
#include "direction.h"
/* enum with actions what we perceive*/
typedef enum keyboard_action{
PLAYER1_UP = 'w',
PLAYER1_UP_CAP = 'W',
PLAYER1_DOWN = 's',
PLAYER1_DOWN_CAP = 'S',
PLAYER1_RIGHT = 'd',
PLAYER1_RIGHT_CAP = 'D',
PLAYER1_LEFT = 'a',
PLAYER1_LEFT_CAP = 'A',
PLAYER2_UP = 'i',
PLAYER2_UP_CAP = 'I',
PLAYER2_DOWN = 'k',
PLAYER2_DOWN_CAP = 'K',
PLAYER2_RIGHT = 'l',
PLAYER2_RIGHT_CAP = 'L',
PLAYER2_LEFT = 'j',
PLAYER2_LEFT_CAP = 'J',
PAUSE = 'p',
PAUSE_CAP = 'P',
QUIT = 'q',
QUIT_CAP = 'Q',
SPACE = ' ',
NOTHING
} keyboard_action;
/* Set knobs directions*/
void update_knobs_direction(direction *red_knob_direction, direction *green_knob_direction, direction *blue_knob_direction);
/* Ger keyboard action now */
keyboard_action read_from_keyboard();
/*Check on user input*/
void get_pause();
#endif /*USER_INPUT_H*/