diff options
Diffstat (limited to 'keyboards/acr60')
| -rw-r--r-- | keyboards/acr60/keymaps/default/keymap.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/keyboards/acr60/keymaps/default/keymap.c b/keyboards/acr60/keymaps/default/keymap.c index a07e0ddc5..aafc1dfe6 100644 --- a/keyboards/acr60/keymaps/default/keymap.c +++ b/keyboards/acr60/keymaps/default/keymap.c | |||
| @@ -1,6 +1,10 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | 2 | ||
| 3 | #define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) | 3 | #define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) |
| 4 | |||
| 5 | enum custom_keycodes { | ||
| 6 | SFT_ESC = SAFE_RANGE | ||
| 7 | }; | ||
| 4 | 8 | ||
| 5 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 9 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 6 | 10 | ||
| @@ -13,7 +17,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 13 | * via the function actions code at the bottom. | 17 | * via the function actions code at the bottom. |
| 14 | */ | 18 | */ |
| 15 | LAYOUT( | 19 | LAYOUT( |
| 16 | F(0), 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_NO, KC_BSPC, | 20 | SFT_ESC,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_NO, KC_BSPC, |
| 17 | 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, | 21 | 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, |
| 18 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, | 22 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, |
| 19 | KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO, | 23 | KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO, |
| @@ -34,21 +38,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 34 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | 38 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), |
| 35 | }; | 39 | }; |
| 36 | 40 | ||
| 37 | enum function_id { | 41 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
| 38 | SHIFT_ESC, | 42 | switch (keycode) { |
| 39 | }; | 43 | case SFT_ESC: |
| 40 | |||
| 41 | const uint16_t PROGMEM fn_actions[] = { | ||
| 42 | [0] = ACTION_FUNCTION(SHIFT_ESC), | ||
| 43 | }; | ||
| 44 | |||
| 45 | void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { | ||
| 46 | static uint8_t shift_esc_shift_mask; | ||
| 47 | switch (id) { | ||
| 48 | case SHIFT_ESC: | ||
| 49 | shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; | ||
| 50 | if (record->event.pressed) { | 44 | if (record->event.pressed) { |
| 51 | if (shift_esc_shift_mask) { | 45 | if (get_mods() & MODS_SHIFT_MASK) { |
| 52 | add_key(KC_GRV); | 46 | add_key(KC_GRV); |
| 53 | send_keyboard_report(); | 47 | send_keyboard_report(); |
| 54 | } else { | 48 | } else { |
| @@ -56,7 +50,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { | |||
| 56 | send_keyboard_report(); | 50 | send_keyboard_report(); |
| 57 | } | 51 | } |
| 58 | } else { | 52 | } else { |
| 59 | if (shift_esc_shift_mask) { | 53 | if (get_mods() & MODS_SHIFT_MASK) { |
| 60 | del_key(KC_GRV); | 54 | del_key(KC_GRV); |
| 61 | send_keyboard_report(); | 55 | send_keyboard_report(); |
| 62 | } else { | 56 | } else { |
| @@ -64,6 +58,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { | |||
| 64 | send_keyboard_report(); | 58 | send_keyboard_report(); |
| 65 | } | 59 | } |
| 66 | } | 60 | } |
| 67 | break; | 61 | |
| 62 | return false; | ||
| 63 | |||
| 64 | default: | ||
| 65 | return true; | ||
| 68 | } | 66 | } |
| 69 | } | 67 | } |
