blob: f0af427cde1206c9d7d67cfe749fb7a0f0e6897c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
/*
* Copyright (C) 2017-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
#include <set>
#include <string>
namespace KODI
{
namespace JOYSTICK
{
/*!
* \ingroup joystick
* \brief Interface for a class working with a keymap
*/
class IKeymapHandler
{
public:
virtual ~IKeymapHandler() = default;
/*!
* \brief Get the pressed state of the given keys
*
* \param keyNames The key names
*
* \return True if all keys are pressed or no keys are given, false otherwise
*/
virtual bool HotkeysPressed(const std::set<std::string>& keyNames) const = 0;
/*!
* \brief Get the key name of the last button pressed
*
* \return The key name of the last-pressed button, or empty if no button
* is pressed
*/
virtual std::string GetLastPressed() const = 0;
/*!
* \brief Called when a key has emitted an action after bring pressed
*
* \param keyName the key name that emitted the action
*/
virtual void OnPress(const std::string& keyName) = 0;
};
} // namespace JOYSTICK
} // namespace KODI
|