kodi
RemoteControlXbox.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include <chrono>
12 #include <string>
13 
14 #include <winrt/Windows.Media.h>
15 
17 {
18 public:
20  virtual ~CRemoteControlXbox();
21  void Initialize();
22  void Disconnect();
23  bool IsRemoteDevice(const std::wstring &deviceId) const;
24 
25 private:
26  void HandleAcceleratorKey(const winrt::Windows::UI::Core::CoreDispatcher&, const winrt::Windows::UI::Core::AcceleratorKeyEventArgs&);
27  void HandleMediaButton(const winrt::Windows::Media::SystemMediaTransportControlsButtonPressedEventArgs&);
28  int32_t TranslateVirtualKey(winrt::Windows::System::VirtualKey vk);
29  int32_t TranslateMediaKey(winrt::Windows::Media::SystemMediaTransportControlsButton mk);
30 
31  bool m_bInitialized;
32  std::chrono::time_point<std::chrono::steady_clock> m_firstClickTime;
33  uint32_t m_repeatCount;
34  winrt::event_token m_token;
35  winrt::event_token m_mediatoken;
36 };
Definition: RemoteControlXbox.h:16