| 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 "MouseTypes.h" |
| 12 |
|
| 13 |
#include <stdint.h> |
| 14 |
|
| 15 |
namespace tinyxml2 |
| 16 |
{ |
| 17 |
class XMLElement; |
| 18 |
} |
| 19 |
|
| 20 |
/*! |
| 21 |
* \ingroup mouse |
| 22 |
*/ |
| 23 |
class CMouseTranslator |
| 24 |
{ |
| 25 |
public: |
| 26 |
/*! |
| 27 |
* \brief Translate a keymap element to a key ID |
| 28 |
*/ |
| 29 |
static uint32_t TranslateCommand(const tinyxml2::XMLElement* pButton); |
| 30 |
|
| 31 |
/*! |
| 32 |
* \brief Translate a mouse event ID to a mouse button index |
| 33 |
* |
| 34 |
* \param eventId The event ID from MouseStat.h |
| 35 |
* \param[out] buttonId The button ID from MouseTypes.h, or unmodified if unsuccessful |
| 36 |
* |
| 37 |
* \return True if successful, false otherwise |
| 38 |
*/ |
| 39 |
static bool TranslateEventID(unsigned int eventId, KODI::MOUSE::BUTTON_ID& buttonId); |
| 40 |
}; |