46 lines
1.5 KiB
C++
46 lines
1.5 KiB
C++
#ifndef KEYBINDINGS_H
|
|
#define KEYBINDINGS_H
|
|
|
|
#include "tier0/platform.h"
|
|
#include "materialsystem/humandevice_enums.h"
|
|
|
|
|
|
abstract_class IHumanDeviceInput
|
|
{
|
|
public:
|
|
virtual EInputType GetInputType() = 0;
|
|
|
|
virtual void OnGameButton( EInputDeviceType eDevice, EInputButton eScancode, bool bIsPressed ) = 0;
|
|
virtual void OnGameAxis( EInputDeviceType eDevice, EInputAxis eAxis, float fValue) = 0;
|
|
virtual void OnGameAxisDiff( EInputDeviceType eDevice, EInputAxis eAxis, float fValue ) = 0;
|
|
|
|
virtual void OnButton( EInputDeviceType eDevice, EInputButton eScancode, bool bIsPressed ) = 0;
|
|
virtual void OnAxis( EInputDeviceType eDevice, EInputAxis eAxis, float fValue) = 0;
|
|
virtual void OnAxisDiff( EInputDeviceType eDevice, EInputAxis eAxis, float fValue ) = 0;
|
|
|
|
virtual void OnTextWriteUTF8( uint32_t uCode ) = 0;
|
|
};
|
|
|
|
abstract_class IHumanDeviceManager
|
|
{
|
|
public:
|
|
virtual void Frame() = 0;
|
|
|
|
virtual void SetDefaultInput( IHumanDeviceInput *pInput ) = 0;
|
|
virtual void PushInput( IHumanDeviceInput *pInput ) = 0;
|
|
virtual void PopInput() = 0;
|
|
virtual IHumanDeviceInput *GetCurrentInput() = 0;
|
|
|
|
virtual void SetButtonPressed( EInputButton eButton ) = 0;
|
|
virtual void SetButtonUnpressed( EInputButton eButton ) = 0;
|
|
virtual void AxisEventRelative( EInputDeviceType eDevice, EInputAxis eAxis, float fValue ) = 0;
|
|
|
|
virtual void WriteUTF8( uint32_t uCode ) = 0;
|
|
};
|
|
|
|
#define HUMAN_DEVICE_MANAGER_INTERFACE_VERSION "HumanDeviceMgr001"
|
|
|
|
extern IHumanDeviceManager *g_pHumanDeviceManager;
|
|
|
|
#endif
|