File: keyb.h

package info (click to toggle)
bomberclone 0.11.9-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,220 kB
  • sloc: ansic: 14,256; sh: 3,800; makefile: 332
file content (53 lines) | stat: -rw-r--r-- 884 bytes parent folder | download | duplicates (4)
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
43
44
45
46
47
48
49
50
51
52
53
/* $:ID $
 * keyboard handling */

#ifndef _KEYB_H_
#define _KEYB_H_

#include "menu.h"

enum _bcplayerkeys {
	BCPK_up = 0,
	BCPK_down,
	BCPK_left,
	BCPK_right,
	BCPK_drop,
	BCPK_special,
	
	BCPK_max 
};

enum _bckeys {
	BCK_help = BCPK_max * 3,
	BCK_esc,
	BCK_fullscreen,
	BCK_chat,
	BCK_pause,
	BCK_playermenu,
	BCK_mapmenu,

	BCK_max
};

struct {
	Uint8 state [BCK_max];	// current state
	Uint8 old [BCK_max];	// old state
	int keycode [BCK_max];	// keycode
} typedef BCGameKeys;

struct {
	int drop;
	int special;
} typedef BCGameJoystick;

extern BCGameKeys keyb_gamekeys;
extern BCGameJoystick joy_keys[2];

extern void keyb_config ();
extern void keyb_config_reset ();
extern void keyb_config_createkeymenu (_menu *menu, int key, int x, int y, int menu_nr);
extern void keyb_config_readkey (int key);
extern void keyb_init ();
extern void keyb_loop (SDL_Event *event);

#endif