diff options
Diffstat (limited to 'keyboard/gh60/keymap.c')
-rw-r--r-- | keyboard/gh60/keymap.c | 45 |
1 files changed, 14 insertions, 31 deletions
diff --git a/keyboard/gh60/keymap.c b/keyboard/gh60/keymap.c index d6af16961..edc1caf19 100644 --- a/keyboard/gh60/keymap.c +++ b/keyboard/gh60/keymap.c @@ -20,7 +20,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" @@ -91,7 +90,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \ LCTL,A, S, D, F, G, H, J, K, L, FN2, QUOT, ENT, \ - LSFT,Z, X, C, V, B, N, M, COMM,DOT, FN1, RSFT, \ + LSFT,Z, X, C, V, B, N, M, COMM,DOT, FN1, FN9, \ LCTL,LGUI,LALT, SPC, RALT,FN3, FN3, FN0), /* Keymap 1: colemak */ KEYMAP_ANSI( @@ -198,54 +197,38 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS), }; -static const uint8_t PROGMEM overlays[][MATRIX_ROWS][MATRIX_COLS] = {}; - /* * Fn action definition */ static const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_KEYMAP_MOMENTARY(4), - [1] = ACTION_KEYMAP_TAP_KEY(5, KC_SLASH), - [2] = ACTION_KEYMAP_TAP_KEY(6, KC_SCLN), - [3] = ACTION_KEYMAP_MOMENTARY(6), - [4] = ACTION_KEYMAP_MOMENTARY(7), // to Layout selector + [0] = ACTION_LAYER_MOMENTARY(4), + [1] = ACTION_LAYER_TAP_KEY(5, KC_SLASH), + [2] = ACTION_LAYER_TAP_KEY(6, KC_SCLN), + [3] = ACTION_LAYER_MOMENTARY(6), + [4] = ACTION_LAYER_MOMENTARY(7), // to Layout selector [5] = ACTION_DEFAULT_LAYER_SET(0), // set qwerty layout [6] = ACTION_DEFAULT_LAYER_SET(1), // set colemak layout [7] = ACTION_DEFAULT_LAYER_SET(2), // set dvorak layout [8] = ACTION_DEFAULT_LAYER_SET(3), // set workman layout + [9] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRV), }; #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 { + // XXX: this may cuaes bootlaoder_jump inconsistent 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)]); } } |