Archived
1
0

Fixing first and last element bug for layers.

This commit is contained in:
Jacob Alexander 2014-09-16 17:21:41 -07:00
parent df82ffeff7
commit ac98d86762

View File

@ -323,8 +323,8 @@ nat_ptr_t *Macro_layerLookup( uint8_t scanCode )
// Determine if layer has key defined // Determine if layer has key defined
// Make sure scanCode is between layer first and last scancodes // Make sure scanCode is between layer first and last scancodes
if ( map != 0 if ( map != 0
&& scanCode < layer->last && scanCode <= layer->last
&& scanCode > layer->first && scanCode >= layer->first
&& *map[ scanCode - layer->first ] != 0 ) && *map[ scanCode - layer->first ] != 0 )
{ {
return map[ scanCode - layer->first ]; 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 // Make sure scanCode is between layer first and last scancodes
if ( map != 0 if ( map != 0
&& scanCode < layer->last && scanCode <= layer->last
&& scanCode > layer->first && scanCode >= layer->first
&& *map[ scanCode - layer->first ] != 0 ) && *map[ scanCode - layer->first ] != 0 )
{ {
return map[ scanCode - layer->first ]; return map[ scanCode - layer->first ];