Mercurial > hg > index.fcgi > lj > lj046
comparison src/pcjoy.h @ 0:c84446dfb3f5
initial add
author | paulo@localhost |
---|---|
date | Fri, 13 Mar 2009 00:39:12 -0700 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:617f3af02834 |
---|---|
1 /* PC joystick code | |
2 | |
3 Copyright (C) 2006 Damian Yerrick <tepples+lj@spamcop.net> | |
4 | |
5 This work is free software; you can redistribute it and/or modify | |
6 it under the terms of the GNU General Public License as published by | |
7 the Free Software Foundation; either version 2 of the License, or | |
8 (at your option) any later version. | |
9 | |
10 This program is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 GNU General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU General Public License | |
16 along with this program; if not, write to the Free Software | |
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | |
19 Original game concept and design by Alexey Pajitnov. | |
20 The Software is not sponsored or endorsed by Alexey Pajitnov, Elorg, | |
21 or The Tetris Company LLC. | |
22 | |
23 */ | |
24 | |
25 #ifndef PCJOY_H | |
26 #define PCJOY_H | |
27 | |
28 #include "ljtypes.h" | |
29 #include "ljcontrol.h" | |
30 | |
31 | |
32 /* Physical key definitions | |
33 | |
34 m.joy < 0: | |
35 key[m.axis] | |
36 m.joy >= 0, m.stick < 0: | |
37 joy[m.joy].button[m.axis].b | |
38 m.joy >= 0, m.stick >= 0, m.axis < 0: | |
39 joy[m.joy].stick[m.stick].axis[~m.axis].d1 | |
40 m.joy >= 0, m.stick >= 0, m.axis >= 0: | |
41 joy[m.joy].stick[m.stick].axis[m.axis].d2 | |
42 */ | |
43 | |
44 struct pkeyMapping { | |
45 signed char joy; | |
46 signed char stick; | |
47 signed char axis; | |
48 }; | |
49 | |
50 extern volatile int wantsClose; | |
51 | |
52 void initKeys(void); | |
53 | |
54 /** | |
55 * Reads the physical keys to produce a set of pressed virtual keys. | |
56 */ | |
57 LJBits readPad(unsigned int player); | |
58 | |
59 /** | |
60 * Reads the physical keys to produce a set of pressed virtual keys, | |
61 * hardcoding keyboard Up, Down, Left, Right, Esc, and Enter | |
62 * to the appropriate vkeys. | |
63 */ | |
64 LJBits menuReadPad(void); | |
65 | |
66 void getPkeyName(char *dst, int j, int s, int a); | |
67 extern const char *const vkeyNames[]; | |
68 void configureKeys(void); | |
69 | |
70 #endif |