Qt: Linux: pass m_filter as a reference to CGamePadInputEventListener

This commit is contained in:
Mahmood(Thunder07) 2018-10-23 01:41:03 +01:00 committed by Mahmood - Zer0xFF
parent 2097d0b0ad
commit 4f38c284f5
3 changed files with 7 additions and 3 deletions

View File

@ -71,6 +71,10 @@ void CGamePadDeviceListener::DisconnectInputEventCallback()
void CGamePadDeviceListener::SetFilter(bool filter)
{
m_filter = filter;
if(m_filter)
{
RePopulateAbs();
}
}
void CGamePadDeviceListener::UpdateDeviceList()

View File

@ -5,7 +5,7 @@
#include <poll.h>
#include <csignal>
CGamePadInputEventListener::CGamePadInputEventListener(std::string device, bool filter)
CGamePadInputEventListener::CGamePadInputEventListener(std::string device, bool& filter)
: m_device(device)
, m_filter(filter)
, m_running(true)

View File

@ -9,7 +9,7 @@
class CGamePadInputEventListener
{
public:
CGamePadInputEventListener(std::string, bool f = false);
CGamePadInputEventListener(std::string, bool& f);
~CGamePadInputEventListener();
void ChangeInputDevice(char* device);
@ -20,7 +20,7 @@ public:
private:
std::string m_device;
std::atomic<bool> m_running;
bool m_filter;
bool& m_filter;
std::thread m_thread;
std::array<struct input_absinfo, ABS_MAX> m_abslist;