| 1 |
/* |
| 2 |
* Copyright (C) 2020-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 |
#include "ButtonStat.h" |
| 9 |
|
| 10 |
#include "input/keyboard/KeyboardTypes.h" |
| 11 |
|
| 12 |
using namespace KODI; |
| 13 |
using namespace KEYMAP; |
| 14 |
|
| 15 |
CButtonStat::CButtonStat() = default; |
| 16 |
|
| 17 |
CKey CButtonStat::TranslateKey(const CKey& key) const |
| 18 |
{ |
| 19 |
uint32_t buttonCode = key.GetButtonCode(); |
| 20 |
if (key.GetHeld() > KEYBOARD::KEY_HOLD_TRESHOLD) |
| 21 |
buttonCode |= CKey::MODIFIER_LONG; |
| 22 |
|
| 23 |
CKey translatedKey(buttonCode, key.GetHeld()); |
| 24 |
return translatedKey; |
| 25 |
} |