]> git.donarmstrong.com Git - tmk_firmware.git/blobdiff - keyboard/hid_liber/keymap.c
Rename file layer_switch to action_layer
[tmk_firmware.git] / keyboard / hid_liber / keymap.c
index f3d6bfa2efb435bba9224778dea2b7952f108069..609edb5e1b9ba5f01ca580b87beafda66603e1fe 100644 (file)
@@ -24,7 +24,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "keycode.h"
 #include "action.h"
 #include "action_macro.h"
-#include "layer_switch.h"
 #include "report.h"
 #include "host.h"
 #include "print.h"
@@ -160,8 +159,6 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 
 };
 
-static const uint8_t PROGMEM overlays[][MATRIX_ROWS][MATRIX_COLS] = {};
-
 /*
  * Fn action definition
  */
@@ -179,33 +176,15 @@ static const uint16_t PROGMEM fn_actions[] = {
 #endif 
 
 #define KEYMAPS_SIZE    (sizeof(keymaps) / sizeof(keymaps[0]))
-#define OVERLAYS_SIZE   (sizeof(overlays) / sizeof(overlays[0]))
 #define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0]))
 
 /* translates key to keycode */
 uint8_t keymap_key_to_keycode(uint8_t layer, key_t key)
 {
-    /* Overlay: 16-31(OVERLAY_BIT(0x10) | overlay_layer) */
-    if (layer & OVERLAY_BIT) {
-        layer &= OVERLAY_MASK;
-        if (layer < OVERLAYS_SIZE) {
-            return pgm_read_byte(&overlays[(layer)][(key.row)][(key.col)]);
-        } else {
-            // XXX: this may cuaes bootlaoder_jump incositent fail.
-            //debug("key_to_keycode: overlay "); debug_dec(layer); debug(" is invalid.\n");
-            return KC_TRANSPARENT;
-        }
-    } 
-    /* Keymap: 0-15 */
-    else {
-        if (layer < KEYMAPS_SIZE) {
-            return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
-        } else {
-            // XXX: this may cuaes bootlaoder_jump incositent fail.
-            //debug("key_to_keycode: base "); debug_dec(layer); debug(" is invalid.\n");
-            // fall back to layer 0
-            return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]);
-        }
+    if (layer < KEYMAPS_SIZE) {
+        return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
+    } else {
+        return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]);
     }
 }