| 1 |
/* |
| 2 |
* Copyright (C) 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 "KeyboardSymbols.h" |
| 12 |
#include "KeyboardTypes.h" |
| 13 |
#include "XBMC_keysym.h" |
| 14 |
|
| 15 |
namespace KODI |
| 16 |
{ |
| 17 |
namespace KEYBOARD |
| 18 |
{ |
| 19 |
|
| 20 |
/*! |
| 21 |
* \brief Keyboard translation utilities |
| 22 |
*/ |
| 23 |
class CKeyboardTranslator |
| 24 |
{ |
| 25 |
public: |
| 26 |
/*! |
| 27 |
* \brief Translate a keyboard symbol to a Kodi key code |
| 28 |
* |
| 29 |
* Keyboard symbols are hardware-independent virtual key representations. |
| 30 |
* They are used to help facilitate keyboard mapping. |
| 31 |
* |
| 32 |
* \param symbol The key's symbol, defined in the Controller Topology Project: |
| 33 |
* https://github.com/kodi-game/controller-topology-project/blob/master/Readme-Keyboard.md |
| 34 |
* |
| 35 |
* \return The layout-independent keycode associated with the key |
| 36 |
*/ |
| 37 |
static XBMCKey TranslateKeysym(const SymbolName& symbolName); |
| 38 |
|
| 39 |
/*! |
| 40 |
* \brief Translate a Kodi key code to a keyboard symbol |
| 41 |
* |
| 42 |
* \param keycode The Kodi key code |
| 43 |
* |
| 44 |
* \return The key's symbol, or an empty string if no symbol is defined for the keycode |
| 45 |
*/ |
| 46 |
static const char* TranslateKeycode(XBMCKey keycode); |
| 47 |
}; |
| 48 |
|
| 49 |
} // namespace KEYBOARD |
| 50 |
} // namespace KODI |