diff options
author | Jack Humbert <jack.humb@gmail.com> | 2017-06-22 12:38:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-22 12:38:45 -0400 |
commit | c21c2cc92bdfc37b50c53b17d4c5df9fdfa293c3 (patch) | |
tree | 98b0e424892e0d55caa35c753754352b17bc0d4e /keyboards/s65_x/keymaps/default/keymap.c | |
parent | fe9556104bcf6b101b95929c93fd21c9026fb4d2 (diff) | |
parent | 8705ac408da2133b60304bb64e21d4f7f605b470 (diff) | |
download | qmk_firmware-c21c2cc92bdfc37b50c53b17d4c5df9fdfa293c3.tar.gz |
Merge pull request #1416 from geofflane/feature/s65_x_std_grv_esc
Use the new Quantum KC_GESC instead of custom code
Diffstat (limited to 'keyboards/s65_x/keymaps/default/keymap.c')
-rw-r--r-- | keyboards/s65_x/keymaps/default/keymap.c | 72 |
1 files changed, 4 insertions, 68 deletions
diff --git a/keyboards/s65_x/keymaps/default/keymap.c b/keyboards/s65_x/keymaps/default/keymap.c index 2b7a091e3..27c9e7c94 100644 --- a/keyboards/s65_x/keymaps/default/keymap.c +++ b/keyboards/s65_x/keymaps/default/keymap.c @@ -1,5 +1,4 @@ #include "s65_x.h" -#include "action_layer.h" #define _BL 0 #define _AL 1 @@ -23,10 +22,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: ANSI qwerty */ [_BL] = ANSI_KEYMAP( - F(4), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ - F(2), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ + F(2), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), @@ -94,74 +93,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; -enum function_id { - SHIFT_ESC, -}; const uint16_t PROGMEM fn_actions[] = { [0] = ACTION_LAYER_MOMENTARY(_FL), // Momentary Fn overlay [1] = ACTION_LAYER_TOGGLE(_AL), // Toggle Arrow Layer overlay [2] = ACTION_LAYER_TAP_KEY(_FL, KC_CAPS),// Tap to toggle caps lock and hold to activate function layer [3] = ACTION_LAYER_TOGGLE(_UL), // Toggle Underglow Layer overlay - [4] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void matrix_scan_user(void) { - - // Would like to do something like this, that would be cool - // Turn off all the LEDs on except for the ones mapped on the UL layer, for example - /* uint32_t layer = layer_state; */ - /* if (layer & (1<<1)) { */ - /* gh60_wasd_leds_on(); */ - /* } else { */ - /* gh60_wasd_leds_off(); */ - /* } */ - /* */ - /* if (layer & (1<<2)) { */ - /* gh60_esc_led_on(); */ - /* } else { */ - /* gh60_esc_led_off(); */ - /* } */ }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) { - static uint8_t shift_esc_shift_mask; - // Shift + ESC = ~ - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -}; |