mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-19 10:31:08 +00:00
adding joy key repeat func
This commit is contained in:
parent
68cb97c864
commit
0e06798db3
1 changed files with 29 additions and 0 deletions
|
@ -492,6 +492,35 @@ void IN_ControllerButton(SDL_JoystickID instanceid, SDL_GameControllerButton but
|
|||
Key_Event(key, down);
|
||||
}
|
||||
|
||||
// from lordhavoc
|
||||
static void IN_KeyEventForButton(qboolean oldbutton, qboolean newbutton, int key, double *timer)
|
||||
{
|
||||
if (oldbutton)
|
||||
{
|
||||
if (newbutton)
|
||||
{
|
||||
if (realtime >= *timer)
|
||||
{
|
||||
Key_Event(key, true);
|
||||
*timer = realtime + 0.1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Key_Event(key, false);
|
||||
*timer = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (newbutton)
|
||||
{
|
||||
Key_Event(key, true);
|
||||
*timer = realtime + 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void IN_ControllerAxis(SDL_JoystickID instanceid, SDL_GameControllerAxis axis, Sint16 value)
|
||||
{
|
||||
float axisValue = Sint16ToPlusMinusOne( value );
|
||||
|
|
Loading…
Reference in a new issue