@@ -281,14 +281,15 @@ void UpdateNativeMenuKeys() {
281
281
int confirmKey = g_Config.iButtonPreference == PSP_SYSTEMPARAM_BUTTON_CROSS ? CTRL_CROSS : CTRL_CIRCLE;
282
282
int cancelKey = g_Config.iButtonPreference == PSP_SYSTEMPARAM_BUTTON_CROSS ? CTRL_CIRCLE : CTRL_CROSS;
283
283
284
- KeyFromPspButton (confirmKey, &confirmKeys);
285
- KeyFromPspButton (cancelKey, &cancelKeys);
286
- KeyFromPspButton (CTRL_LTRIGGER, &tabLeft);
287
- KeyFromPspButton (CTRL_RTRIGGER, &tabRight);
288
- KeyFromPspButton (CTRL_UP, &upKeys);
289
- KeyFromPspButton (CTRL_DOWN, &downKeys);
290
- KeyFromPspButton (CTRL_LEFT, &leftKeys);
291
- KeyFromPspButton (CTRL_RIGHT, &rightKeys);
284
+ // Mouse mapping might be problematic in UI, so let's ignore mouse for UI
285
+ KeyFromPspButton (confirmKey, &confirmKeys, true );
286
+ KeyFromPspButton (cancelKey, &cancelKeys, true );
287
+ KeyFromPspButton (CTRL_LTRIGGER, &tabLeft, true );
288
+ KeyFromPspButton (CTRL_RTRIGGER, &tabRight, true );
289
+ KeyFromPspButton (CTRL_UP, &upKeys, true );
290
+ KeyFromPspButton (CTRL_DOWN, &downKeys, true );
291
+ KeyFromPspButton (CTRL_LEFT, &leftKeys, true );
292
+ KeyFromPspButton (CTRL_RIGHT, &rightKeys, true );
292
293
293
294
#ifdef __ANDROID__
294
295
// Hardcode DPAD on Android
@@ -786,11 +787,12 @@ bool KeyToPspButton(int deviceId, int key, std::vector<int> *pspKeys) {
786
787
}
787
788
788
789
// TODO: vector output
789
- bool KeyFromPspButton (int btn, std::vector<KeyDef> *keys) {
790
+ bool KeyFromPspButton (int btn, std::vector<KeyDef> *keys, bool ignoreMouse ) {
790
791
for (auto iter = g_controllerMap.begin (); iter != g_controllerMap.end (); ++iter) {
791
792
if (iter->first == btn) {
792
793
for (auto iter2 = iter->second .begin (); iter2 != iter->second .end (); ++iter2) {
793
- keys->push_back (*iter2);
794
+ if (!ignoreMouse || iter2->deviceId != DEVICE_ID_MOUSE)
795
+ keys->push_back (*iter2);
794
796
}
795
797
}
796
798
}
@@ -911,7 +913,7 @@ void SaveToIni(IniFile &file) {
911
913
912
914
for (size_t i = 0 ; i < ARRAY_SIZE (psp_button_names); i++) {
913
915
std::vector<KeyDef> keys;
914
- KeyFromPspButton (psp_button_names[i].key , &keys);
916
+ KeyFromPspButton (psp_button_names[i].key , &keys, false );
915
917
916
918
std::string value;
917
919
for (size_t j = 0 ; j < keys.size (); j++) {
0 commit comments