mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-16 14:15:45 -04:00
Android: Add analog button to touchscreen controller
This commit is contained in:
@ -1619,3 +1619,20 @@ DEFINE_JNI_ARGS_METHOD(jobjectArray, AndroidHostInterface_getSaveStateInfo, jobj
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
DEFINE_JNI_ARGS_METHOD(void, AndroidHostInterface_toggleControllerAnalogMode, jobject obj) {
|
||||
// hacky way to toggle analog mode
|
||||
for (u32 i = 0; i < NUM_CONTROLLER_AND_CARD_PORTS; i++)
|
||||
{
|
||||
Controller* ctrl = System::GetController(i);
|
||||
if (!ctrl)
|
||||
continue;
|
||||
|
||||
std::optional<s32> code = Controller::GetButtonCodeByName(ctrl->GetType(), "Analog");
|
||||
if (!code.has_value())
|
||||
continue;
|
||||
|
||||
ctrl->SetButtonState(code.value(), true);
|
||||
ctrl->SetButtonState(code.value(), false);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user