From ac98d86762cad685257e63abc3223196afb8dd2d Mon Sep 17 00:00:00 2001 From: Jacob Alexander Date: Tue, 16 Sep 2014 17:21:41 -0700 Subject: [PATCH] Fixing first and last element bug for layers. --- Macro/PartialMap/macro.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 ];