Add weapon cycling bindings for mouse and joystick buttons. Add weapon cycling bindi...
[chocolate-doom.git] / src / d_event.h
blob4578870f22af2d1a4d85dcb0ba2094746aad2c39
1 // Emacs style mode select -*- C++ -*-
2 //-----------------------------------------------------------------------------
3 //
4 // Copyright(C) 1993-1996 Id Software, Inc.
5 // Copyright(C) 2005 Simon Howard
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // of the License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 // 02111-1307, USA.
22 // DESCRIPTION:
24 //
25 //-----------------------------------------------------------------------------
28 #ifndef __D_EVENT__
29 #define __D_EVENT__
32 #include "doomtype.h"
36 // Event handling.
39 // Input event types.
40 typedef enum
42 ev_keydown,
43 ev_keyup,
44 ev_mouse,
45 ev_joystick
46 } evtype_t;
48 // Event structure.
49 typedef struct
51 evtype_t type;
52 int data1; // keys / mouse/joystick buttons
53 int data2; // mouse/joystick x move
54 int data3; // mouse/joystick y move
55 } event_t;
58 typedef enum
60 ga_nothing,
61 ga_loadlevel,
62 ga_newgame,
63 ga_loadgame,
64 ga_savegame,
65 ga_playdemo,
66 ga_completed,
67 ga_victory,
68 ga_worlddone,
69 ga_screenshot
70 } gameaction_t;
75 // Button/action code definitions.
77 typedef enum
79 // Press "Fire".
80 BT_ATTACK = 1,
81 // Use button, to open doors, activate switches.
82 BT_USE = 2,
84 // Flag: game events, not really buttons.
85 BT_SPECIAL = 128,
86 BT_SPECIALMASK = 3,
88 // Flag, weapon change pending.
89 // If true, the next 3 bits hold weapon num.
90 BT_CHANGE = 4,
91 // The 3bit weapon mask and shift, convenience.
92 BT_WEAPONMASK = (8+16+32),
93 BT_WEAPONSHIFT = 3,
95 // Pause the game.
96 BTS_PAUSE = 1,
97 // Save the game at each console.
98 BTS_SAVEGAME = 2,
100 // Savegame slot numbers
101 // occupy the second byte of buttons.
102 BTS_SAVEMASK = (4+8+16),
103 BTS_SAVESHIFT = 2,
105 } buttoncode_t;
111 // GLOBAL VARIABLES
114 extern gameaction_t gameaction;
117 #endif