mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-18 05:45:45 -04:00
Merge pull request #806 from CookiePLMonster/axis-to-button-map
Allow mapping axes to buttons
This commit is contained in:
@ -466,10 +466,10 @@ std::optional<s32> AnalogController::StaticGetButtonCodeByName(std::string_view
|
||||
|
||||
Controller::AxisList AnalogController::StaticGetAxisNames()
|
||||
{
|
||||
return {{TRANSLATABLE("AnalogController", "LeftX"), static_cast<s32>(Axis::LeftX)},
|
||||
{TRANSLATABLE("AnalogController", "LeftY"), static_cast<s32>(Axis::LeftY)},
|
||||
{TRANSLATABLE("AnalogController", "RightX"), static_cast<s32>(Axis::RightX)},
|
||||
{TRANSLATABLE("AnalogController", "RightY"), static_cast<s32>(Axis::RightY)}};
|
||||
return {{TRANSLATABLE("AnalogController", "LeftX"), static_cast<s32>(Axis::LeftX), AxisType::Full},
|
||||
{TRANSLATABLE("AnalogController", "LeftY"), static_cast<s32>(Axis::LeftY), AxisType::Full},
|
||||
{TRANSLATABLE("AnalogController", "RightX"), static_cast<s32>(Axis::RightX), AxisType::Full},
|
||||
{TRANSLATABLE("AnalogController", "RightY"), static_cast<s32>(Axis::RightY), AxisType::Full}};
|
||||
}
|
||||
|
||||
Controller::ButtonList AnalogController::StaticGetButtonNames()
|
||||
|
@ -14,8 +14,14 @@ class HostInterface;
|
||||
class Controller
|
||||
{
|
||||
public:
|
||||
enum class AxisType : u8
|
||||
{
|
||||
Full,
|
||||
Half
|
||||
};
|
||||
|
||||
using ButtonList = std::vector<std::pair<std::string, s32>>;
|
||||
using AxisList = std::vector<std::pair<std::string, s32>>;
|
||||
using AxisList = std::vector<std::tuple<std::string, s32, AxisType>>;
|
||||
using SettingList = std::vector<SettingInfo>;
|
||||
|
||||
Controller();
|
||||
|
@ -219,12 +219,12 @@ std::optional<s32> NeGcon::StaticGetButtonCodeByName(std::string_view button_nam
|
||||
|
||||
Controller::AxisList NeGcon::StaticGetAxisNames()
|
||||
{
|
||||
#define A(n) \
|
||||
#define A(n, t) \
|
||||
{ \
|
||||
#n, static_cast <s32>(Axis::n) \
|
||||
#n, static_cast <s32>(Axis::n), Controller::AxisType::t \
|
||||
}
|
||||
|
||||
return {A(Steering), A(I), A(II), A(L)};
|
||||
return {A(Steering, Full), A(I, Half), A(II, Half), A(L, Half)};
|
||||
|
||||
#undef A
|
||||
}
|
||||
|
Reference in New Issue
Block a user