summaryrefslogtreecommitdiffstats
path: root/keyboards/kona_classic/keymaps/iso_arrows/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/kona_classic/keymaps/iso_arrows/keymap.c')
-rw-r--r--keyboards/kona_classic/keymaps/iso_arrows/keymap.c38
1 files changed, 16 insertions, 22 deletions
diff --git a/keyboards/kona_classic/keymaps/iso_arrows/keymap.c b/keyboards/kona_classic/keymaps/iso_arrows/keymap.c
index 79e52360ca..44fb94fd9e 100644
--- a/keyboards/kona_classic/keymaps/iso_arrows/keymap.c
+++ b/keyboards/kona_classic/keymaps/iso_arrows/keymap.c
@@ -15,7 +15,7 @@
*/
#include QMK_KEYBOARD_H
-#define MODS_SHFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))
+#define MODS_SHIFT_GUI_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))
#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))
// Helpful defines
@@ -25,11 +25,15 @@
#define _DEFAULT 0
#define _FN 1
+enum custom_keycodes {
+ SFT_ESC = SAFE_RANGE
+};
+
//RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_DEFAULT] = LAYOUT_iso_arrows(
- KC_F1, KC_F2, 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_BSPC, \
+ KC_F1, KC_F2, 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_BSPC, \
KC_F3, KC_F4, 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_ENT, \
KC_F5, KC_F6, 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_NUHS, \
KC_F7, KC_F8, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, MO(_FN), \
@@ -55,29 +59,15 @@ void matrix_scan_user(void) {
}
-bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- return true;
-}
-
void led_set_user(uint8_t usb_led) {
}
-enum function_id {
- ESCAPE,
-};
-
-const uint16_t PROGMEM fn_actions[] = {
- [0] = ACTION_FUNCTION(ESCAPE),
-};
-
-void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
- static uint8_t shift_esc_shift_mask;
- switch (id) {
- case ESCAPE:
- shift_esc_shift_mask = get_mods()&MODS_SHFT_MASK;
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case SFT_ESC:
if (record->event.pressed) {
- if (shift_esc_shift_mask) {
+ if (get_mods() & MODS_SHIFT_GUI_MASK) {
add_key(KC_GRV);
send_keyboard_report();
} else {
@@ -85,7 +75,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
send_keyboard_report();
}
} else {
- if (shift_esc_shift_mask) {
+ if (get_mods() & MODS_SHIFT_GUI_MASK) {
del_key(KC_GRV);
send_keyboard_report();
} else {
@@ -93,6 +83,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
send_keyboard_report();
}
}
- break;
+
+ return false;
+
+ default:
+ return true;
}
}