diff --git a/controller/gamepad.c b/controller/gamepad.c index d9218ed..e7a325d 100644 --- a/controller/gamepad.c +++ b/controller/gamepad.c @@ -444,7 +444,7 @@ static void GamepadUpdateDevice(GAMEPAD_DEVICE gamepad) { if (events[i].value) { STATE[gamepad].bCurrent |= BUTTON_TO_FLAG(button); } else { - STATE[gamepad].bCurrent ^= BUTTON_TO_FLAG(button); + STATE[gamepad].bCurrent &= ~BUTTON_TO_FLAG(button); } break; case EV_ABS: diff --git a/dll/steam_controller.h b/dll/steam_controller.h index 5b9240a..aa2fe52 100644 --- a/dll/steam_controller.h +++ b/dll/steam_controller.h @@ -133,6 +133,7 @@ public ISteamInput std::map steamcontroller_glyphs; bool disabled; + bool initialized; void set_handles(std::map, std::string>>> action_sets) { uint64 handle_num = 1; @@ -214,6 +215,7 @@ Steam_Controller(class Settings *settings, class SteamCallResults *callback_resu set_handles(settings->controller_settings.action_sets); disabled = !action_handles.size(); + initialized = false; } ~Steam_Controller() @@ -245,6 +247,7 @@ bool Init() controllers.insert(std::pair(i, cont_action)); } + initialized = true; return true; } @@ -277,7 +280,7 @@ void SetOverrideMode( const char *pchMode ) void RunFrame() { PRINT_DEBUG("Steam_Controller::RunFrame()\n"); - if (disabled) { + if (disabled || !initialized) { return; }