]> git.donarmstrong.com Git - kiibohd-kll.git/commitdiff
Fixing layered assignment bug.
authorJacob Alexander <haata@kiibohd.com>
Wed, 17 Sep 2014 01:14:06 +0000 (18:14 -0700)
committerJacob Alexander <haata@kiibohd.com>
Wed, 17 Sep 2014 01:14:06 +0000 (18:14 -0700)
- Layered assignments were lost due to how the cached assignments were replayed
- Replaying each assignment cache after each file is done processing

kll.py
kll_lib/containers.py

diff --git a/kll.py b/kll.py
index fc7b42648544793f9a1728ab37016d49aeff45e8..6d79b2e0295e75f077c0e57b401394a8c912bf80 100755 (executable)
--- a/kll.py
+++ b/kll.py
@@ -558,8 +558,8 @@ if __name__ == '__main__':
        # Default combined layer
        for filename in defaultFiles:
                processKLLFile( filename )
        # 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:
 
        # Iterate through additional layers
        for partial in partialFileSets:
index b96cc32d6577845e41eee80704ac7a61347a8480..f732649fb5c2a75148e28757572aefedf4c57d46 100644 (file)
@@ -146,7 +146,8 @@ class Macros:
                self.macros[ self.layer ][ trigger ] = [ result ]
 
                # Mark layer scan code, so it won't be removed later
                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
                        del self.layerLayoutMarkers[ self.layer ][ trigger ]
 
        # Return a list of ScanCode triggers with the given USB Code trigger