]> git.donarmstrong.com Git - kiibohd-controller.git/commitdiff
Fixing first and last element bug for layers.
authorJacob Alexander <haata@kiibohd.com>
Wed, 17 Sep 2014 00:21:41 +0000 (17:21 -0700)
committerJacob Alexander <haata@kiibohd.com>
Wed, 17 Sep 2014 00:21:41 +0000 (17:21 -0700)
Macro/PartialMap/macro.c

index bfcd3225c6fbe678bd4793278c5b08c17337cb3e..c23df2ea17336ba4366c4e224638bcedd09fa25d 100644 (file)
@@ -323,8 +323,8 @@ nat_ptr_t *Macro_layerLookup( uint8_t scanCode )
                        // Determine if layer has key defined
                        // Make sure scanCode is between layer first and last scancodes
                        if ( map != 0
-                         && scanCode < layer->last
-                         && scanCode > layer->first
+                         && scanCode <= layer->last
+                         && scanCode >= layer->first
                          && *map[ scanCode - layer->first ] != 0 )
                        {
                                return map[ scanCode - layer->first ];
@@ -340,8 +340,8 @@ nat_ptr_t *Macro_layerLookup( uint8_t scanCode )
 
        // Make sure scanCode is between layer first and last scancodes
        if ( map != 0
-         && scanCode < layer->last
-         && scanCode > layer->first
+         && scanCode <= layer->last
+         && scanCode >= layer->first
          && *map[ scanCode - layer->first ] != 0 )
        {
                return map[ scanCode - layer->first ];