#pragma once #include #include struct libevdev; class Console; class LinuxGameController { private: int _fd = -1; int _deviceID = -1; libevdev *_device = nullptr; bool _disconnected = false; std::thread _eventThread; std::atomic _stopFlag; shared_ptr _console; int _axisDefaultValue[0x100]; LinuxGameController(shared_ptr console, int deviceID, int fileDescriptor, libevdev *device); bool CheckAxis(unsigned int code, bool forPositive); void Calibrate(); public: ~LinuxGameController(); static std::shared_ptr GetController(shared_ptr console, int deviceID, bool logInformation); bool IsDisconnected(); int GetDeviceID(); bool IsButtonPressed(int buttonNumber); };