2 * Copyright (C) 2005-2013 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
22 #if defined(HAS_LINUX_EVENTS)
24 #include "WinEventsLinux.h"
25 #include "WinEvents.h"
26 #include "XBMC_events.h"
27 #include "input/XBMC_keysym.h"
28 #include "Application.h"
29 #include "input/MouseStat.h"
30 #include "utils/log.h"
31 #include "powermanagement/PowerManager.h"
33 bool CWinEventsLinux::m_initialized = false;
34 CLinuxInputDevices CWinEventsLinux::m_devices;
36 CWinEventsLinux::CWinEventsLinux()
40 void CWinEventsLinux::RefreshDevices()
42 m_devices.InitAvailable();
45 bool CWinEventsLinux::IsRemoteLowBattery()
47 return m_devices.IsRemoteLowBattery();
51 bool CWinEventsLinux::MessagePump()
55 m_devices.InitAvailable();
60 XBMC_Event event = {0};
63 event = m_devices.ReadEvent();
64 if (event.type != XBMC_NOEVENT)
66 ret |= g_application.OnEvent(event);
77 size_t CWinEventsLinux::GetQueueSize()
79 return m_devices.Size();