Mercurial > hg > index.fcgi > lj > lj046
view src/pcjoy.h @ 0:c84446dfb3f5
initial add
author | paulo@localhost |
---|---|
date | Fri, 13 Mar 2009 00:39:12 -0700 |
parents | |
children |
line source
1 /* PC joystick code
3 Copyright (C) 2006 Damian Yerrick <tepples+lj@spamcop.net>
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.
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.
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
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.
23 */
25 #ifndef PCJOY_H
26 #define PCJOY_H
28 #include "ljtypes.h"
29 #include "ljcontrol.h"
32 /* Physical key definitions
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 */
44 struct pkeyMapping {
45 signed char joy;
46 signed char stick;
47 signed char axis;
48 };
50 extern volatile int wantsClose;
52 void initKeys(void);
54 /**
55 * Reads the physical keys to produce a set of pressed virtual keys.
56 */
57 LJBits readPad(unsigned int player);
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);
66 void getPkeyName(char *dst, int j, int s, int a);
67 extern const char *const vkeyNames[];
68 void configureKeys(void);
70 #endif