From: Jacob Alexander Date: Wed, 17 Sep 2014 00:21:41 +0000 (-0700) Subject: Fixing first and last element bug for layers. X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ac98d86762cad685257e63abc3223196afb8dd2d;p=kiibohd-controller.git Fixing first and last element bug for layers. --- diff --git a/Macro/PartialMap/macro.c b/Macro/PartialMap/macro.c index bfcd322..c23df2e 100644 --- a/Macro/PartialMap/macro.c +++ b/Macro/PartialMap/macro.c @@ -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 ];