mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2024-10-30 21:20:10 +00:00
Fix some possible controller issues.
This commit is contained in:
parent
958ced0edd
commit
c9d97abd5b
@ -444,7 +444,7 @@ static void GamepadUpdateDevice(GAMEPAD_DEVICE gamepad) {
|
|||||||
if (events[i].value) {
|
if (events[i].value) {
|
||||||
STATE[gamepad].bCurrent |= BUTTON_TO_FLAG(button);
|
STATE[gamepad].bCurrent |= BUTTON_TO_FLAG(button);
|
||||||
} else {
|
} else {
|
||||||
STATE[gamepad].bCurrent ^= BUTTON_TO_FLAG(button);
|
STATE[gamepad].bCurrent &= ~BUTTON_TO_FLAG(button);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EV_ABS:
|
case EV_ABS:
|
||||||
|
@ -133,6 +133,7 @@ public ISteamInput
|
|||||||
std::map<EControllerActionOrigin, std::string> steamcontroller_glyphs;
|
std::map<EControllerActionOrigin, std::string> steamcontroller_glyphs;
|
||||||
|
|
||||||
bool disabled;
|
bool disabled;
|
||||||
|
bool initialized;
|
||||||
|
|
||||||
void set_handles(std::map<std::string, std::map<std::string, std::pair<std::set<std::string>, std::string>>> action_sets) {
|
void set_handles(std::map<std::string, std::map<std::string, std::pair<std::set<std::string>, std::string>>> action_sets) {
|
||||||
uint64 handle_num = 1;
|
uint64 handle_num = 1;
|
||||||
@ -214,6 +215,7 @@ Steam_Controller(class Settings *settings, class SteamCallResults *callback_resu
|
|||||||
|
|
||||||
set_handles(settings->controller_settings.action_sets);
|
set_handles(settings->controller_settings.action_sets);
|
||||||
disabled = !action_handles.size();
|
disabled = !action_handles.size();
|
||||||
|
initialized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
~Steam_Controller()
|
~Steam_Controller()
|
||||||
@ -245,6 +247,7 @@ bool Init()
|
|||||||
controllers.insert(std::pair<ControllerHandle_t, struct Controller_Action>(i, cont_action));
|
controllers.insert(std::pair<ControllerHandle_t, struct Controller_Action>(i, cont_action));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initialized = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,7 +280,7 @@ void SetOverrideMode( const char *pchMode )
|
|||||||
void RunFrame()
|
void RunFrame()
|
||||||
{
|
{
|
||||||
PRINT_DEBUG("Steam_Controller::RunFrame()\n");
|
PRINT_DEBUG("Steam_Controller::RunFrame()\n");
|
||||||
if (disabled) {
|
if (disabled || !initialized) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user