call InputHandler::Update

This commit is contained in:
Glenn Maynard
2003-07-13 01:05:05 +00:00
parent 82aabe7c3a
commit dc7182f749
4 changed files with 12 additions and 16 deletions
@@ -2,7 +2,6 @@
#include "InputHandler_Linux_Joystick.h"
#include "RageLog.h"
#include "RageUtil.h"
#include "InputFilter.h"
#include <stdio.h>
#include <unistd.h>
@@ -81,15 +80,15 @@ void InputHandler_Linux_Joystick::Update(float fDeltaTime)
event.type &= ~JS_EVENT_INIT;
switch (event.type) {
case JS_EVENT_BUTTON: {
INPUTFILTER->ButtonPressed(DeviceInput(id, JOY_1 + event.number), event.value);
ButtonPressed(DeviceInput(id, JOY_1 + event.number), event.value);
break;
}
case JS_EVENT_AXIS: {
JoystickButton neg = (JoystickButton)(JOY_LEFT+2*event.number);
JoystickButton pos = (JoystickButton)(JOY_RIGHT+2*event.number);
INPUTFILTER->ButtonPressed(DeviceInput(id, neg), event.value < -16000);
INPUTFILTER->ButtonPressed(DeviceInput(id, pos), event.value > +16000);
ButtonPressed(DeviceInput(id, neg), event.value < -16000);
ButtonPressed(DeviceInput(id, pos), event.value > +16000);
break;
}
@@ -4,7 +4,6 @@
#include "InputHandler_Linux_tty.h"
#include "InputHandler_Linux_tty_keys.h"
#include "InputFilter.h"
#include "RageUtil.h"
#include "RageLog.h"
@@ -183,7 +182,7 @@ void InputHandler_Linux_tty::Update(float fDeltaTime)
const int butno = keys[key];
const bool pressed = !(keybuf[i] & 0x80);
INPUTFILTER->ButtonPressed(DeviceInput(DEVICE_KEYBOARD, butno), pressed);
ButtonPressed(DeviceInput(DEVICE_KEYBOARD, butno), pressed);
}
}
@@ -11,7 +11,6 @@
*/
#include "InputHandler_SDL.h"
#include "SDL_utils.h"
#include "InputFilter.h"
#include "RageLog.h"
static const Sint8 Handled_SDL_Events[] = {
@@ -90,7 +89,7 @@ void InputHandler_SDL::Update(float fDeltaTime)
case SDL_KEYUP:
{
DeviceInput di(DEVICE_KEYBOARD, event.key.keysym.sym);
INPUTFILTER->ButtonPressed(di, event.key.state == SDL_PRESSED);
ButtonPressed(di, event.key.state == SDL_PRESSED);
}
continue;
@@ -105,7 +104,7 @@ void InputHandler_SDL::Update(float fDeltaTime)
continue;
}
DeviceInput di(i, Button);
INPUTFILTER->ButtonPressed(di, event.jbutton.state == SDL_PRESSED);
ButtonPressed(di, event.jbutton.state == SDL_PRESSED);
continue;
}
@@ -114,18 +113,18 @@ void InputHandler_SDL::Update(float fDeltaTime)
InputDevice i = InputDevice(DEVICE_JOY1 + event.jaxis.which);
JoystickButton neg = (JoystickButton)(JOY_LEFT+2*event.jaxis.axis);
JoystickButton pos = (JoystickButton)(JOY_RIGHT+2*event.jaxis.axis);
INPUTFILTER->ButtonPressed(DeviceInput(i, neg), event.jaxis.value < -16000);
INPUTFILTER->ButtonPressed(DeviceInput(i, pos), event.jaxis.value > +16000);
ButtonPressed(DeviceInput(i, neg), event.jaxis.value < -16000);
ButtonPressed(DeviceInput(i, pos), event.jaxis.value > +16000);
continue;
}
case SDL_JOYHATMOTION:
{
InputDevice i = InputDevice(DEVICE_JOY1 + event.jhat.which);
INPUTFILTER->ButtonPressed(DeviceInput(i, JOY_HAT_UP), !!(event.jhat.value & SDL_HAT_UP));
INPUTFILTER->ButtonPressed(DeviceInput(i, JOY_HAT_DOWN), !!(event.jhat.value & SDL_HAT_DOWN));
INPUTFILTER->ButtonPressed(DeviceInput(i, JOY_HAT_LEFT), !!(event.jhat.value & SDL_HAT_LEFT));
INPUTFILTER->ButtonPressed(DeviceInput(i, JOY_HAT_RIGHT), !!(event.jhat.value & SDL_HAT_RIGHT));
ButtonPressed(DeviceInput(i, JOY_HAT_UP), !!(event.jhat.value & SDL_HAT_UP));
ButtonPressed(DeviceInput(i, JOY_HAT_DOWN), !!(event.jhat.value & SDL_HAT_DOWN));
ButtonPressed(DeviceInput(i, JOY_HAT_LEFT), !!(event.jhat.value & SDL_HAT_LEFT));
ButtonPressed(DeviceInput(i, JOY_HAT_RIGHT), !!(event.jhat.value & SDL_HAT_RIGHT));
continue;
}
}
@@ -3,7 +3,6 @@
#include "RageLog.h"
#include "RageInputDevice.h"
#include "InputFilter.h"
#include "archutils/Win32/USB.h"
InputHandler_Win32_Pump::InputHandler_Win32_Pump()