From b4e4a13811f38b2ba6b36b0fd194c4dd399f61f8 Mon Sep 17 00:00:00 2001 From: Jacob Alexander Date: Tue, 16 Sep 2014 18:14:06 -0700 Subject: [PATCH] Fixing layered assignment bug. - Layered assignments were lost due to how the cached assignments were replayed - Replaying each assignment cache after each file is done processing --- kll.py | 4 ++-- kll_lib/containers.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/kll.py b/kll.py index fc7b426..6d79b2e 100755 --- a/kll.py +++ b/kll.py @@ -558,8 +558,8 @@ if __name__ == '__main__': # Default combined layer for filename in defaultFiles: processKLLFile( filename ) - # Apply assignment cache, see 5.1.2 USB Codes for why this is necessary - macros_map.replayCachedAssignments() + # Apply assignment cache, see 5.1.2 USB Codes for why this is necessary + macros_map.replayCachedAssignments() # Iterate through additional layers for partial in partialFileSets: diff --git a/kll_lib/containers.py b/kll_lib/containers.py index b96cc32..f732649 100644 --- a/kll_lib/containers.py +++ b/kll_lib/containers.py @@ -146,7 +146,8 @@ class Macros: self.macros[ self.layer ][ trigger ] = [ result ] # Mark layer scan code, so it won't be removed later - if not self.baseLayout is None: + # Also check to see if it hasn't already been removed before + if not self.baseLayout is None and trigger in self.layerLayoutMarkers[ self.layer ]: del self.layerLayoutMarkers[ self.layer ][ trigger ] # Return a list of ScanCode triggers with the given USB Code trigger