11 #include "EventPacket.h" 12 #include "ServiceBroker.h" 14 #include "settings/Settings.h" 15 #include "settings/SettingsComponent.h" 16 #include "threads/CriticalSection.h" 17 #include "threads/Thread.h" 28 #define ES_FLAG_UNICODE 0x80000000 // new 16bit key flag to support real unicode over EventServer 43 std::string actionName;
44 unsigned char actionType;
58 m_iControllerNumber = 0;
64 std::string buttonName,
69 : m_buttonName(std::move(buttonName)), m_mapName(std::move(mapName))
71 m_iKeyCode = iKeyCode;
73 m_bUseAmount = bUseAmount;
77 m_iControllerNumber = 0;
82 void Reset() { m_bActive =
false; }
83 void SetActive() { m_bActive =
true; }
84 bool Active()
const {
return m_bActive; }
85 bool Repeat()
const {
return m_bRepeat; }
86 int ControllerNumber()
const {
return m_iControllerNumber; }
87 bool Axis()
const {
return m_bAxis; }
88 unsigned int KeyCode()
const {
return m_iKeyCode; }
89 float Amount()
const {
return m_fAmount; }
91 const std::string& JoystickName()
const {
return m_joystickName; }
92 const std::string& CustomControllerName()
const {
return m_customControllerName; }
95 unsigned int m_iKeyCode;
96 unsigned short m_iControllerNumber;
97 std::string m_buttonName;
98 std::string m_mapName;
99 std::string m_joystickName;
100 std::string m_customControllerName;
106 std::chrono::time_point<std::chrono::steady_clock> m_iNextRepeat;
134 m_iCurrentSeqLen = 0;
138 m_bMouseMoved =
false;
139 m_bSequenceError =
false;
143 const std::string& Name()
const 148 void RefreshSettings()
150 const std::shared_ptr<CSettings>
settings = CServiceBroker::GetSettingsComponent()->GetSettings();
152 std::chrono::milliseconds(settings->GetInt(CSettings::SETTING_SERVICES_ESINITIALDELAY));
153 m_iRepeatSpeed = std::chrono::milliseconds(
154 settings->GetInt(CSettings::SETTING_SERVICES_ESCONTINUOUSDELAY));
168 bool AddPacket(std::unique_ptr<EVENTPACKET::CEventPacket> packet);
177 void ProcessEvents();
183 void FreePacketQueues();
186 unsigned int GetButtonCode(std::string& strMapName,
bool& isAxis,
float& amount,
bool &isJoystick);
189 bool GetMousePos(
float& x,
float& y);
202 bool CheckButtonRepeat(std::chrono::time_point<std::chrono::steady_clock>& next);
205 bool Greeted() {
return m_bGreeted; }
210 m_lastPing = time(NULL);
221 bool ParseString(
unsigned char* &payload,
int &psize, std::string& parsedVal);
224 bool ParseByte(
unsigned char* &payload,
int &psize,
unsigned char& parsedVal);
227 bool ParseUInt32(
unsigned char* &payload,
int &psize,
unsigned int& parsedVal);
230 bool ParseUInt16(
unsigned char* &payload,
int &psize,
unsigned short& parsedVal);
232 std::string m_deviceName;
233 int m_iCurrentSeqLen;
238 std::chrono::milliseconds m_iRepeatDelay;
239 std::chrono::milliseconds m_iRepeatSpeed;
240 unsigned int m_iMouseX;
241 unsigned int m_iMouseY;
243 bool m_bSequenceError;
247 EVENTPACKET::LogoType m_eLogoType;
248 CCriticalSection m_critSection;
250 std::map<unsigned int, std::unique_ptr<EVENTPACKET::CEventPacket>> m_seqPackets;
251 std::queue<std::unique_ptr<EVENTPACKET::CEventPacket>> m_readyPackets;
254 std::list<CEventButtonState> m_buttonQueue;
255 std::queue<CEventAction> m_actionQueue;
Definition: EventPacket.h:196
Definition: EventClient.h:115
Definition: EventClient.h:25
Definition: EventClient.h:30
Definition: settings.py:1