haxis/Source/UnrealProject/External/InputDeviceBases.hpp

47 lines
1.2 KiB
C++

#ifndef _HEADER_INPUT_DEVICE_BASES
#define _HEADER_INPUT_DEVICE_BASES
#include "InputEnums.hpp"
#include "TeaVector2.hpp"
#include "TeaVector3.hpp"
namespace Input
{
enum InputDeviceType
{
IDT_NONE,
IDT_NOTDEFINED,
IDT_XBOX,
IDT_DS4
};
class InputDevice
{
public:
virtual void Update() = 0;
};
class Keyboard : public InputDevice
{
public:
virtual bool GetKey(const InputKey a_Key) = 0;
virtual bool GetKeyDown(const InputKey a_Key) = 0;
};
class Joystick : public InputDevice
{
public:
virtual ~Joystick() {};
virtual bool GetButton(const InputJoystickButton a_JoystickButton) = 0;
virtual bool GetButton(const InputJoystickPhysical a_JoystickButton) = 0;
virtual bool GetButtonDown(const InputJoystickButton a_JoystickButton) = 0;
virtual bool GetButtonDown(const InputJoystickPhysical a_JoystickButton) = 0;
virtual bool GetButtonUp(const InputJoystickButton a_JoystickButton) = 0;
virtual bool GetButtonUp(const InputJoystickPhysical a_JoystickButton) = 0;
virtual bool IsValid() = 0;
virtual TeaLib::Math::Vector2f GetDelta(const InputJoystickAxis a_InputStick) = 0;
virtual InputDeviceType GetDeviceType() = 0;
};
}
#endif