mirror of
https://github.com/ZDoom/Raze.git
synced 2025-05-30 08:51:08 +00:00
- added ZDoom's keybinding class and some needed support code.
Not hooked up yet with the game.
This commit is contained in:
parent
12a02cb456
commit
73e64ff0b2
11 changed files with 1809 additions and 0 deletions
72
source/common/console/d_event.h
Normal file
72
source/common/console/d_event.h
Normal file
|
@ -0,0 +1,72 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright 1993-1996 id Software
|
||||
// Copyright 1999-2016 Randy Heit
|
||||
// Copyright 2002-2016 Christoph Oelckers
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see http://www.gnu.org/licenses/
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef __D_EVENT_H__
|
||||
#define __D_EVENT_H__
|
||||
|
||||
|
||||
#include <functional>
|
||||
|
||||
|
||||
//
|
||||
// Event handling.
|
||||
//
|
||||
|
||||
// Input event types.
|
||||
enum EGenericEvent
|
||||
{
|
||||
EV_None,
|
||||
EV_KeyDown, // data1: scan code, data2: Qwerty ASCII code
|
||||
EV_KeyUp, // same
|
||||
EV_Mouse, // x, y: mouse movement deltas
|
||||
EV_GUI_Event, // subtype specifies actual event
|
||||
EV_DeviceChange,// a device has been connected or removed
|
||||
};
|
||||
|
||||
// Event structure.
|
||||
struct event_t
|
||||
{
|
||||
uint8_t type;
|
||||
uint8_t subtype;
|
||||
int16_t data1; // keys / mouse/joystick buttons
|
||||
int16_t data2;
|
||||
int16_t data3;
|
||||
int x; // mouse/joystick x move
|
||||
int y; // mouse/joystick y move
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Called by IO functions when input is detected.
|
||||
void D_PostEvent (const event_t* ev);
|
||||
void D_RemoveNextCharEvent();
|
||||
|
||||
|
||||
//
|
||||
// GLOBAL VARIABLES
|
||||
//
|
||||
#define MAXEVENTS 128
|
||||
|
||||
extern event_t events[MAXEVENTS];
|
||||
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue