kodi
IKeyboardInputHandler.h
1 /*
2  * Copyright (C) 2017-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/keyboard/KeyboardTypes.h"
12 
13 #include <stdint.h>
14 #include <string>
15 
16 namespace KODI
17 {
18 namespace KEYBOARD
19 {
29 {
30 public:
31  virtual ~IKeyboardInputHandler() = default;
32 
38  virtual std::string ControllerID() const = 0;
39 
47  virtual bool HasKey(const KeyName& key) const = 0;
48 
58  virtual bool OnKeyPress(const KeyName& key, Modifier mod, uint32_t unicode) = 0;
59 
67  virtual void OnKeyRelease(const KeyName& key, Modifier mod, uint32_t unicode) = 0;
68 };
69 } // namespace KEYBOARD
70 } // namespace KODI
virtual bool OnKeyPress(const KeyName &key, Modifier mod, uint32_t unicode)=0
A key has been pressed.
std::string KeyName
Name of a hardware-indendent symbol representing a key.
Definition: KeyboardTypes.h:33
Interface for handling input events for keyboards.
Definition: IKeyboardInputHandler.h:28
virtual std::string ControllerID() const =0
The add-on ID of the keyboard&#39;s controller profile.
virtual bool HasKey(const KeyName &key) const =0
Return true if the input handler accepts the given key.
Definition: AudioDecoder.h:18
virtual void OnKeyRelease(const KeyName &key, Modifier mod, uint32_t unicode)=0
A key has been released.