From e556213a44efe77da2bd569f42357bcc2d8ed2a5 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Fri, 17 Nov 2017 12:39:39 -0600 Subject: [PATCH] Use new populateFieldMapping method for custom actions --- DS4Windows/DS4Control/Mapping.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index bb1fc13..b455eb2 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -72,6 +72,11 @@ namespace DS4Windows new DS4StateFieldMapping(), new DS4StateFieldMapping(), new DS4StateFieldMapping(), new DS4StateFieldMapping() }; + public static DS4StateFieldMapping[] previousFieldMappings = new DS4StateFieldMapping[4] + { + new DS4StateFieldMapping(), new DS4StateFieldMapping(), new DS4StateFieldMapping(), + new DS4StateFieldMapping() + }; // TODO When we disconnect, process a null/dead state to release any keys or buttons. public static DateTime oldnow = DateTime.UtcNow; @@ -2008,7 +2013,9 @@ namespace DS4Windows // button is assigned if (previousFieldMapping == null) { - previousFieldMapping = new DS4StateFieldMapping(tempPrevState, eState, tp, true); + previousFieldMapping = previousFieldMappings[device]; + previousFieldMapping.populateFieldMapping(tempPrevState, eState, tp, true); + //previousFieldMapping = new DS4StateFieldMapping(tempPrevState, eState, tp, true); } bool activeCur = getBoolMapping2(device, action.trigger[0], cState, eState, tp, fieldMapping);