Better (but not great) workaround for key bindings that pop up dialogs.

This commit is contained in:
Henrik Rydgård committed 2023-05-02 21:36:17 +02:00
1 parent eee4640962
commit c037f6731d
5 files changed
+32 -5

No files matched your search

+17
View File
@@ -153,6 +153,23 @@ void ControlMapper::UpdateAnalogOutput(int stick) {
setPSPAnalog_(stick, x, y);
}
void ControlMapper::ForceReleaseVKey(int vkey) {
std::vector<KeyMap::MultiInputMapping> multiMappings;
if (KeyMap::InputMappingsFromPspButton(vkey, &multiMappings, true)) {
for (const auto &entry : multiMappings) {
for (const auto &mapping : entry.mappings) {
int direction = 0;
if (mapping.IsAxis() && IsSignedAxis(mapping.Axis(&direction))) {
curInput_[mapping] = direction == -1 ? -1 : 1;
} else {
curInput_[mapping] = 0.0f;
}
UpdatePSPState(mapping);
}
}
}
}
static int RotatePSPKeyCode(int x) {
switch (x) {
case CTRL_UP: return CTRL_RIGHT;