# HG changeset patch # User Jacob Alexander # Date 1410913301 25200 # Node ID 00a8c7f491d49e788442d257d604491a1fe1eebc # Parent 5a5404338b9f9f481592be7f80b6951316a7b193 Fixing first and last element bug for layers. diff -r 5a5404338b9f -r 00a8c7f491d4 Macro/PartialMap/macro.c --- a/Macro/PartialMap/macro.c Tue Sep 16 17:04:59 2014 -0700 +++ b/Macro/PartialMap/macro.c Tue Sep 16 17:21:41 2014 -0700 @@ -323,8 +323,8 @@ // 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 @@ // 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 ];