mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-20 16:31:03 +00:00
Add a "repeated" field to event_t
This commit is contained in:
parent
8adf4b672a
commit
38e82e55fc
3 changed files with 4 additions and 2 deletions
|
@ -36,6 +36,7 @@ typedef struct
|
|||
INT32 data1; // keys / mouse/joystick buttons
|
||||
INT32 data2; // mouse/joystick x move
|
||||
INT32 data3; // mouse/joystick y move
|
||||
boolean repeated; // key repeat
|
||||
} event_t;
|
||||
|
||||
//
|
||||
|
|
|
@ -1012,7 +1012,7 @@ void I_ShutdownJoystick(void)
|
|||
|
||||
void I_GetJoystickEvents(void)
|
||||
{
|
||||
static event_t event = {0,0,0,0};
|
||||
static event_t event = {0,0,0,0,false};
|
||||
INT32 i = 0;
|
||||
UINT64 joyhats = 0;
|
||||
#if 0
|
||||
|
@ -1282,7 +1282,7 @@ void I_ShutdownJoystick2(void)
|
|||
|
||||
void I_GetJoystick2Events(void)
|
||||
{
|
||||
static event_t event = {0,0,0,0};
|
||||
static event_t event = {0,0,0,0,false};
|
||||
INT32 i = 0;
|
||||
UINT64 joyhats = 0;
|
||||
#if 0
|
||||
|
|
|
@ -664,6 +664,7 @@ static void Impl_HandleKeyboardEvent(SDL_KeyboardEvent evt, Uint32 type)
|
|||
return;
|
||||
}
|
||||
event.data1 = Impl_SDL_Scancode_To_Keycode(evt.keysym.scancode);
|
||||
event.repeated = (evt.repeat != 0);
|
||||
if (event.data1) D_PostEvent(&event);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue