libOpenWinControls
Multiplatform open-source library to interact with the dual-mode controller in GPD devices
Loading...
Searching...
No Matches
Utils.h
1/*
2 * This file is part of libOpenWinControls.
3 * Copyright (C) 2026 kylon
4 *
5 * libOpenWinControls is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * libOpenWinControls is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18#pragma once
19
20#include <cstdint>
21
22#include "include/export.h"
24#include "include/BackButtonMode.h"
25#include "include/BackButtonMacroType.h"
26#include "include/LedMode.h"
27#include "include/RumbleMode.h"
28
29namespace OWC {
30 [[nodiscard]] std::wstring bufferToString(const uint8_t *buf, int sz);
31 [[nodiscard]] std::wstring strTowstr(const char *str);
32 [[nodiscard]] std::string strToUpper(const std::string &str);
33 [[nodiscard]] bool findHIDKeycode(const std::string &key, uint16_t &outCode);
34 [[nodiscard]] bool findXinputKeycode(const std::string &key, uint16_t &outCode);
35 [[nodiscard]] int getBytesSum(const uint8_t *buf, int len);
36
37 [[nodiscard]] OWC_EXPORT std::string rumbleModeToString(RumbleMode mode);
38 [[nodiscard]] OWC_EXPORT std::string ledModeToString(LedMode mode);
39 [[nodiscard]] OWC_EXPORT std::string emulationModeToString(EmulationMode mode);
40 [[nodiscard]] OWC_EXPORT std::string backButtonModeToString(BackButtonMode mode);
41 [[nodiscard]] OWC_EXPORT std::string backButtonMacroTypeToString(BackButtonMacroType type);
42}
EmulationMode
controller emulation mode
Definition EmulationMode.h:28
LedMode
led mode
Definition LedMode.h:28
RumbleMode
vibration intensity
Definition RumbleMode.h:28