X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=kll_lib%2Fcontainers.py;h=814cd5cc044de8c4ef4b66fe22c0229130471598;hb=refs%2Fheads%2Fdonlayout;hp=66aa2f26469492066709293e69108ec41d12bb05;hpb=114d666bd873a7044917eea5d5e061ed4e45aafd;p=kiibohd-kll.git diff --git a/kll_lib/containers.py b/kll_lib/containers.py index 66aa2f2..814cd5c 100644 --- a/kll_lib/containers.py +++ b/kll_lib/containers.py @@ -236,6 +236,19 @@ class Macros: return scanCodeList + # Check whether we should do soft replacement + def softReplaceCheck( self, scanCode ): + # First check if not the default layer + if self.layer == 0: + return True + + # Check if current layer is set the same as the BaseMap + if not self.baseLayout is None and scanCode in self.layerLayoutMarkers[ self.layer ]: + return False + + # Otherwise, allow replacement + return True + # Cache USBCode Assignment def cacheAssignment( self, operator, scanCode, result ): self.assignmentCache.append( [ operator, scanCode, result ] ) @@ -254,7 +267,7 @@ class Macros: self.removeScanCode( item[1], item[2] ) # Replace Case - elif item[0] == ":": + elif item[0] == ":" or item[0] == "::": self.replaceScanCode( item[1], item[2] ) # Clear assignment cache