xbmc
IKeymap.h
1 /*
2  * Copyright (C) 2017-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 
12 
13 #include <string>
14 
15 class IKeymapEnvironment;
16 
22 class IKeymap
23 {
24 public:
25  virtual ~IKeymap() = default;
26 
32  virtual std::string ControllerID() const = 0;
33 
37  virtual const IKeymapEnvironment* Environment() const = 0;
38 
46  virtual const KODI::JOYSTICK::KeymapActionGroup& GetActions(const std::string& keyName) const = 0;
47 };
48 
55 {
56 public:
57  virtual ~IWindowKeymap() = default;
58 
64  virtual std::string ControllerID() const = 0;
65 
73  virtual void MapAction(int windowId,
74  const std::string& keyName,
75  KODI::JOYSTICK::KeymapAction action) = 0;
76 
85  virtual const KODI::JOYSTICK::KeymapActionGroup& GetActions(int windowId,
86  const std::string& keyName) const = 0;
87 };
virtual const IKeymapEnvironment * Environment() const =0
Access properties of the keymapping environment.
Interface for mapping buttons to Kodi actions.
Definition: IKeymap.h:22
Container that sorts action entries by their holdtime.
Definition: JoystickTypes.h:180
Action entry in joystick.xml.
Definition: JoystickTypes.h:166
virtual std::string ControllerID() const =0
The controller ID.
virtual const KODI::JOYSTICK::KeymapActionGroup & GetActions(const std::string &keyName) const =0
Get the actions for a given key name.
Interface for mapping buttons to Kodi actions for specific windows.
Definition: IKeymap.h:54
Customizes the environment in which keymapping is performed.
Definition: IKeymapEnvironment.h:21