Fix gamepad hotkey and game profile setting (#510)

This commit is contained in:
goeiecool9999 2022-11-24 12:29:29 +01:00 committed by GitHub
parent c43fc81f8e
commit cbdf381b31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 79 additions and 64 deletions

View file

@ -50,11 +50,8 @@ extern WindowInfo g_window_info;
ControllerState KeyboardController::raw_state()
{
ControllerState result{};
if (g_window_info.app_active)
{
boost::container::small_vector<uint32, 16> pressedKeys;
g_window_info.iter_keystates([&pressedKeys](const std::pair<const uint32, bool>& keyState) { if (keyState.second) pressedKeys.emplace_back(keyState.first); });
result.buttons.SetPressedButtons(pressedKeys);
}
boost::container::small_vector<uint32, 16> pressedKeys;
g_window_info.iter_keystates([&pressedKeys](const std::pair<const uint32, bool>& keyState) { if (keyState.second) pressedKeys.emplace_back(keyState.first); });
result.buttons.SetPressedButtons(pressedKeys);
return result;
}