Skip to content

Commit

Permalink
Logic fix, optimization, remove hack. See post-comments on #17215
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Apr 1, 2023
1 parent 47785aa commit ae0110d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
10 changes: 2 additions & 8 deletions Core/KeyMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,6 @@ void UpdateNativeMenuKeys() {
cancelKeys.push_back(hardcodedCancelKeys[i]);
}

// For DInput controllers on Windows. Doesn't clash with XInput because that uses BUTTON_X etc.
#if PPSSPP_PLATFORM(WINDOWS) && !PPSSPP_PLATFORM(UWP)
confirmKeys.push_back(InputMapping(DEVICE_ID_PAD_0, NKCODE_BUTTON_2));
cancelKeys.push_back(InputMapping(DEVICE_ID_PAD_0, NKCODE_BUTTON_3));
#endif

SetDPadKeys(upKeys, downKeys, leftKeys, rightKeys);
SetConfirmCancelKeys(confirmKeys, cancelKeys);
SetTabLeftRightKeys(tabLeft, tabRight);
Expand Down Expand Up @@ -527,7 +521,8 @@ bool InputMappingsFromPspButton(int btn, std::vector<MultiInputMapping> *mapping
}
bool mapped = false;
for (auto iter2 = iter->second.begin(); iter2 != iter->second.end(); ++iter2) {
if (mappings && (!ignoreMouse || iter2->HasMouse())) {
bool ignore = ignoreMouse && iter2->HasMouse();
if (mappings && !ignore) {
mapped = true;
mappings->push_back(*iter2);
}
Expand Down Expand Up @@ -650,7 +645,6 @@ void SetInputMapping(int btn, const MultiInputMapping &key, bool replace) {
for (auto &mapping : key.mappings) {
g_seenDeviceIds.insert(mapping.deviceId);
}
UpdateNativeMenuKeys();
}

void RestoreDefault() {
Expand Down
2 changes: 2 additions & 0 deletions UI/ControlMappingScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ void SingleControlMapper::MappedCallback(MultiInputMapping kdf) {
SetFocus();
break;
}
KeyMap::UpdateNativeMenuKeys();
g_Config.bMapMouse = false;
}

Expand Down Expand Up @@ -1169,6 +1170,7 @@ UI::EventReturn VisualMappingScreen::OnBindAll(UI::EventParams &e) {

void VisualMappingScreen::HandleKeyMapping(MultiInputMapping key) {
KeyMap::SetInputMapping(nextKey_, key, replace_);
KeyMap::UpdateNativeMenuKeys();

if (bindAll_ < 0) {
// For analog, we do each direction in a row.
Expand Down
2 changes: 1 addition & 1 deletion pspautotests
Submodule pspautotests updated 1 files
+13 −13 README.md

0 comments on commit ae0110d

Please sign in to comment.