From 1e82db0f9e600e1d0a76ad058a9260d226ffaae4 Mon Sep 17 00:00:00 2001 From: mika-n Date: Sun, 7 Apr 2019 14:33:42 +0300 Subject: [PATCH] Allow LoadProfile action key to be used without unload trigger in a loadProfile special action definition and without temp profile lockdown. This way loadProfile special actions can be linked to load unlimited number of profiles without unloading (=untrigger) the current temp profile first. --- DS4Windows/DS4Control/Mapping.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index 5632ba4..2e5253f 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -1896,11 +1896,15 @@ namespace DS4Windows { actionFound = true; - if (!actionDone[index].dev[device] && !useTempProfile[device]) + if (!actionDone[index].dev[device] && (!useTempProfile[device] || untriggeraction[device] == null || untriggeraction[device].typeID != SpecialAction.ActionTypeId.Profile) ) { actionDone[index].dev[device] = true; - untriggeraction[device] = action; - untriggerindex[device] = index; + // If Loadprofile special action doesn't have unload trigger then don't set untrigger status. This way the new loaded profile allows yet another loadProfile action key events) + if (action.uTrigger.Count > 0) + { + untriggeraction[device] = action; + untriggerindex[device] = index; + } //foreach (DS4Controls dc in action.trigger) for (int i = 0, arlen = action.trigger.Count; i < arlen; i++) {