summaryrefslogtreecommitdiffstats
path: root/keyboards/satan/keymaps/colemak
diff options
context:
space:
mode:
authorfauxpark <fauxpark@gmail.com>2019-02-15 15:07:13 +1100
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-02-14 20:07:13 -0800
commit9e4ac6cf29e6b2ce950135c8f877c95f2d1f1d55 (patch)
treedf6cfe88ce0f51ea5ca7fd6b93aae7eaed67d8a5 /keyboards/satan/keymaps/colemak
parentd5bc7fc1575543eb27cffcc465a8f0c4e11b7de7 (diff)
Migrate fn_actions for default keymaps (#4935)
* Migrate fn_actions for default keymaps * Rename the Grave/Escape Shift masks * No need for shift_esc_shift_mask * Change breaks to return false * Right align pointers * Add default case * Separate cases with empty lines
Diffstat (limited to 'keyboards/satan/keymaps/colemak')
-rw-r--r--keyboards/satan/keymaps/colemak/keymap.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/keyboards/satan/keymaps/colemak/keymap.c b/keyboards/satan/keymaps/colemak/keymap.c
index d81ca08933..a772e92c7c 100644
--- a/keyboards/satan/keymaps/colemak/keymap.c
+++ b/keyboards/satan/keymaps/colemak/keymap.c
@@ -3,7 +3,7 @@
// Used for SHIFT_ESC
-#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
+#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
@@ -14,6 +14,10 @@
#define _______ KC_TRNS
+enum custom_keycodes {
+ SFT_ESC = SAFE_RANGE
+};
+
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: (Base Layer) Default Layer
* ,-----------------------------------------------------------.
@@ -29,7 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------'
*/
[_BL] = LAYOUT_60_ansi(
- 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, \
+ 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_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC,KC_BSLS, \
KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O,KC_QUOT, KC_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \
@@ -40,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | | | | RESET|
* |-----------------------------------------------------------|
* | | | | | | | | | | | |BL-|BL+|BL |
- * |--------------------------------------------ΩΩ---------------|
+ * |-----------------------------------------------------------|
* | | | | | | | | | | | | |
* |-----------------------------------------------------------|
* | | F1|F2 | F3|F4 | F5| F6| F7| F8| | | |
@@ -64,21 +68,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
#endif
};
-enum function_id {
- SHIFT_ESC,
-};
-
-const uint16_t PROGMEM fn_actions[] = {
- [0] = ACTION_FUNCTION(SHIFT_ESC),
-};
-
-void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
- static uint8_t shift_esc_shift_mask;
- switch (id) {
- case SHIFT_ESC:
- shift_esc_shift_mask = get_mods()&MODS_CTRL_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_MASK) {
add_key(KC_GRV);
send_keyboard_report();
} else {
@@ -86,7 +80,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_MASK) {
del_key(KC_GRV);
send_keyboard_report();
} else {
@@ -94,6 +88,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
send_keyboard_report();
}
}
- break;
+
+ return false;
+
+ default:
+ return true;
}
}