kodi
JoystickEasterEgg.h
1 /*
2  * Copyright (C) 2016-2024 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 "input/joysticks/interfaces/IButtonSequence.h"
12 
13 #include <map>
14 #include <string>
15 #include <vector>
16 
17 namespace KODI
18 {
19 namespace JOYSTICK
20 {
27 {
28 public:
29  explicit CJoystickEasterEgg(const std::string& controllerId);
30  ~CJoystickEasterEgg() override = default;
31 
32  // implementation of IButtonSequence
33  bool OnButtonPress(const FeatureName& feature) override;
34  bool IsCapturing() override;
35 
36  static void OnFinish(void);
37 
38 private:
39  // Construction parameters
40  const std::string m_controllerId;
41 
42  static const std::map<std::string, std::vector<FeatureName>> m_sequence;
43 
44  unsigned int m_state = 0;
45 };
46 } // namespace JOYSTICK
47 } // namespace KODI
Hush!!!
Definition: JoystickEasterEgg.h:26
bool IsCapturing() override
Returns true if a sequence is being captured to prevent input from falling through to the application...
Definition: JoystickEasterEgg.cpp:89
Definition: IButtonSequence.h:20
Definition: AudioDecoder.h:18
static void OnFinish(void)
Definition: JoystickEasterEgg.cpp:95