libOpenWinControls
Multiplatform open-source library to interact with the dual-mode controller in GPD devices
Toggle main menu visibility
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
#include <cstdint>
20
21
#include "include/export.h"
22
#include "
include/EmulationMode.h
"
23
#include "include/BackButtonMode.h"
24
#include "include/BackButtonMacroType.h"
25
#include "
include/LedMode.h
"
26
#include "
include/RumbleMode.h
"
27
28
namespace
OWC {
29
[[nodiscard]] std::wstring bufferToString(
const
uint8_t *buf,
int
sz);
30
[[nodiscard]] std::wstring strTowstr(
const
char
*str);
31
[[nodiscard]] std::string strToUpper(
const
std::string &str);
32
[[nodiscard]]
bool
findHIDKeycode(
const
std::string &key, uint16_t &outCode);
33
[[nodiscard]]
bool
findXinputKeycode(
const
std::string &key, uint16_t &outCode,
int
controllerType);
34
[[nodiscard]]
int
getBytesSum(
const
uint8_t *buf,
int
len);
35
36
[[nodiscard]] OWC_EXPORT std::string rumbleModeToString(
RumbleMode
mode);
37
[[nodiscard]] OWC_EXPORT std::string ledModeToString(
LedMode
mode);
38
[[nodiscard]] OWC_EXPORT std::string emulationModeToString(
EmulationMode
mode);
39
[[nodiscard]] OWC_EXPORT std::string backButtonModeToString(BackButtonMode mode);
40
[[nodiscard]] OWC_EXPORT std::string backButtonMacroTypeToString(BackButtonMacroType type);
41
}
EmulationMode.h
OWC::EmulationMode
EmulationMode
controller emulation mode
Definition
EmulationMode.h:28
LedMode.h
OWC::LedMode
LedMode
led mode
Definition
LedMode.h:28
RumbleMode.h
OWC::RumbleMode
RumbleMode
vibration intensity
Definition
RumbleMode.h:28
src
Utils.h
Generated by
1.18.0