diff options
| author | Mats Nilsson <matni403@gmail.com> | 2021-06-19 02:55:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-18 17:55:56 -0700 |
| commit | 8de028f1889da418de52bdc1da138687c4944378 (patch) | |
| tree | e99c298cf3a55bc4ef6a6f9f942cc832b996ee26 | |
| parent | 8694e2d3f074ffbdc9f3fc1c0a5fe3c6b4163f5d (diff) | |
| download | qmk_firmware-8de028f1889da418de52bdc1da138687c4944378.tar.gz qmk_firmware-8de028f1889da418de52bdc1da138687c4944378.zip | |
[Keymap] Add my keymaps for the Keebio Iris and Planck (#13005)
| -rw-r--r-- | keyboards/keebio/iris/keymaps/mnil/config.h | 29 | ||||
| -rw-r--r-- | keyboards/keebio/iris/keymaps/mnil/keymap.c | 94 | ||||
| -rw-r--r-- | keyboards/keebio/iris/keymaps/mnil/readme.md | 2 | ||||
| -rw-r--r-- | keyboards/keebio/iris/keymaps/mnil/rules.mk | 1 | ||||
| -rw-r--r-- | keyboards/planck/keymaps/mnil/config.h | 23 | ||||
| -rw-r--r-- | keyboards/planck/keymaps/mnil/keymap.c | 60 | ||||
| -rw-r--r-- | keyboards/planck/keymaps/mnil/readme.md | 2 | ||||
| -rw-r--r-- | users/mnil/config.h | 21 | ||||
| -rw-r--r-- | users/mnil/mnil.c | 146 | ||||
| -rw-r--r-- | users/mnil/mnil.h | 85 | ||||
| -rw-r--r-- | users/mnil/readme.md | 23 | ||||
| -rw-r--r-- | users/mnil/rules.mk | 7 |
12 files changed, 493 insertions, 0 deletions
diff --git a/keyboards/keebio/iris/keymaps/mnil/config.h b/keyboards/keebio/iris/keymaps/mnil/config.h new file mode 100644 index 000000000..091df08ef --- /dev/null +++ b/keyboards/keebio/iris/keymaps/mnil/config.h | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | /* Copyright 2021 Mats Nilsson | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #define EE_HANDS | ||
| 20 | |||
| 21 | #undef RGBLED_NUM | ||
| 22 | #define RGBLIGHT_ANIMATIONS | ||
| 23 | #define RGBLED_NUM 12 | ||
| 24 | #define RGBLIGHT_HUE_STEP 8 | ||
| 25 | #define RGBLIGHT_SAT_STEP 8 | ||
| 26 | #define RGBLIGHT_VAL_STEP 8 | ||
| 27 | #define RGBLIGHT_SPLIT \ | ||
| 28 | { 6, 6 } | ||
| 29 | #define RGBLIGHT_SLEEP | ||
diff --git a/keyboards/keebio/iris/keymaps/mnil/keymap.c b/keyboards/keebio/iris/keymaps/mnil/keymap.c new file mode 100644 index 000000000..7c7dc1a40 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/mnil/keymap.c | |||
| @@ -0,0 +1,94 @@ | |||
| 1 | /* Copyright 2021 Mats Nilsson | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include "mnil.h" | ||
| 18 | |||
| 19 | const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {5, 5, 5, 5}; | ||
| 20 | |||
| 21 | #define HSV_DEFAULT 32, 255, 255 | ||
| 22 | |||
| 23 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
| 24 | state = update_tri_layer_state(state, _SYMBOLS, _NAVIGATION, _NUMPAD); | ||
| 25 | |||
| 26 | switch (get_highest_layer(state)) { | ||
| 27 | case _NUMPAD: | ||
| 28 | rgblight_sethsv_noeeprom(HSV_GREEN); | ||
| 29 | break; | ||
| 30 | case _NAVIGATION: | ||
| 31 | rgblight_sethsv_noeeprom(HSV_MAGENTA); | ||
| 32 | break; | ||
| 33 | case _SYMBOLS: | ||
| 34 | rgblight_sethsv_noeeprom(HSV_AZURE); | ||
| 35 | break; | ||
| 36 | default: // for any other layers, or the default layer | ||
| 37 | rgblight_sethsv_noeeprom(HSV_DEFAULT); | ||
| 38 | break; | ||
| 39 | } | ||
| 40 | return state; | ||
| 41 | } | ||
| 42 | |||
| 43 | // clang-format off | ||
| 44 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 45 | [_COLEMAK] = LAYOUT( | ||
| 46 | //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ | ||
| 47 | KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, | ||
| 48 | //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ | ||
| 49 | KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, TD(OAA), KC_NO, | ||
| 50 | //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ | ||
| 51 | KC_LSFT, TD(AAE), KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, KC_NO, | ||
| 52 | //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ | ||
| 53 | KC_LCTL, KC_Z, KC_X, KC_C, KC_D, KC_V, _NAV_SPC, _SYM_ENT,KC_K, KC_H, KC_COMM, KC_DOT, SE_MINS, KC_LGUI, | ||
| 54 | //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ | ||
| 55 | KC_LGUI, SFT_TAB, _NAV_SPC, _SYM_ENT,CTL_BSPC,ALT_DEL), | ||
| 56 | // └────────┴────────┴────────┘ └────────┴────────┴────────┘ | ||
| 57 | [_SYMBOLS] = LAYOUT( | ||
| 58 | //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ | ||
| 59 | KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, | ||
| 60 | //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ | ||
| 61 | KC_TRNS, KC_NO, SE_PIPE, SE_LBRC, SE_RBRC, KC_NO, S(KC_5), SE_QUES, SE_AT, SE_EQL, SE_DLR, KC_TRNS, | ||
| 62 | //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ | ||
| 63 | KC_TRNS, SE_LCBR, SE_RCBR, SE_LPRN, SE_RPRN, KC_NO, SE_PLUS, S(KC_1), S(KC_2), S(KC_3), SE_AMPR, KC_TRNS, | ||
| 64 | //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ | ||
| 65 | KC_TRNS, M_TILD, M_CIRC, SE_LESS, SE_GRTR, KC_NO, KC_TRNS, KC_TRNS, SE_APOS, SE_SLSH, SE_BSLS, SE_ASTR, M_BTCK, KC_TRNS, | ||
| 66 | //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ | ||
| 67 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), | ||
| 68 | // └────────┴────────┴────────┘ └────────┴────────┴────────┘ | ||
| 69 | [_NAVIGATION] = LAYOUT( | ||
| 70 | //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ | ||
| 71 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 72 | //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ | ||
| 73 | KC_TRNS, KC_NO, CUT, COPY, PASTE, AUTOFILL, KC_NO, KC_HOME, KC_WH_D, KC_WH_U, KC_END, KC_NO, | ||
| 74 | //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ | ||
| 75 | KC_TRNS, KC_ACL0, KC_ACL1, KC_BTN2, KC_BTN1, KC_LCTL, KC_WH_L, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_WH_R, | ||
| 76 | //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ | ||
| 77 | KC_TRNS, KC_ACL2, KC_BTN4, KC_BTN3, KC_BTN5, KC_NO, KC_TRNS, KC_TRNS, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_LCTL, | ||
| 78 | //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ | ||
| 79 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), | ||
| 80 | // └────────┴────────┴────────┘ └────────┴────────┴────────┘ | ||
| 81 | [_NUMPAD] = LAYOUT( | ||
| 82 | //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ | ||
| 83 | RGB_TOG, RGB_M_P, RGB_M_B, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, | ||
| 84 | //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ | ||
| 85 | KC_TRNS, QUIT, WIN, MVWSL , MVWSR, CRYWS, TERM, KC_7, KC_8, KC_9, KC_COMM, KC_NO, | ||
| 86 | //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ | ||
| 87 | KC_TRNS, CS_TAB, C_TAB, PRVWS, NXTWS, I3MOD, OPEN, KC_4, KC_5, KC_6, KC_0, KC_NO, | ||
| 88 | //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ | ||
| 89 | KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, MOVWS, KC_TRNS, KC_TRNS, BROWSER, KC_1, KC_2, KC_3, KC_DOT, KC_NO, | ||
| 90 | //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ | ||
| 91 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), | ||
| 92 | // └────────┴────────┴────────┘ └────────┴────────┴────────┘ | ||
| 93 | }; | ||
| 94 | // clang-format on | ||
diff --git a/keyboards/keebio/iris/keymaps/mnil/readme.md b/keyboards/keebio/iris/keymaps/mnil/readme.md new file mode 100644 index 000000000..e74eea471 --- /dev/null +++ b/keyboards/keebio/iris/keymaps/mnil/readme.md | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | # mnil's iris keymap | ||
| 2 | Read my user settings [here](../../../../../users/mnil/readme.md) for more details. | ||
diff --git a/keyboards/keebio/iris/keymaps/mnil/rules.mk b/keyboards/keebio/iris/keymaps/mnil/rules.mk new file mode 100644 index 000000000..22e6c8fcc --- /dev/null +++ b/keyboards/keebio/iris/keymaps/mnil/rules.mk | |||
| @@ -0,0 +1 @@ | |||
| RGBLIGHT_ENABLE = yes | |||
diff --git a/keyboards/planck/keymaps/mnil/config.h b/keyboards/planck/keymaps/mnil/config.h new file mode 100644 index 000000000..2dc8e19be --- /dev/null +++ b/keyboards/planck/keymaps/mnil/config.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | /* Copyright 2021 Mats Nilsson | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #ifdef AUDIO_ENABLE | ||
| 20 | # define STARTUP_SONG SONG(NO_SOUND) | ||
| 21 | #endif | ||
| 22 | |||
| 23 | #define MIDI_BASIC | ||
diff --git a/keyboards/planck/keymaps/mnil/keymap.c b/keyboards/planck/keymaps/mnil/keymap.c new file mode 100644 index 000000000..85d84d2c6 --- /dev/null +++ b/keyboards/planck/keymaps/mnil/keymap.c | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | /* Copyright 2021 Mats Nilsson | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include "mnil.h" | ||
| 18 | |||
| 19 | layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _SYMBOLS, _NAVIGATION, _NUMPAD); } | ||
| 20 | |||
| 21 | // clang-format off | ||
| 22 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 23 | |||
| 24 | [_COLEMAK] = LAYOUT_planck_2x2u( | ||
| 25 | KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, TD(OAA), KC_BSPC, | ||
| 26 | KC_TAB, TD(AAE), KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, KC_NO, | ||
| 27 | KC_LSFT, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, SE_MINS, KC_NO , | ||
| 28 | KC_LCTL, KC_NO, KC_LGUI, SFT_TAB, _NAV_SPC, _SYM_ENT, CTL_BSPC,ALT_DEL, KC_NO, KC_LGUI | ||
| 29 | ), | ||
| 30 | |||
| 31 | [_QWERTY] = LAYOUT_planck_2x2u( | ||
| 32 | KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, SE_AA, | ||
| 33 | KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SE_OSLH, SE_AE, | ||
| 34 | KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_TRNS, | ||
| 35 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
| 36 | ), | ||
| 37 | |||
| 38 | [_SYMBOLS] = LAYOUT_planck_2x2u( | ||
| 39 | KC_TRNS, KC_NO, SE_PIPE, SE_LBRC, SE_RBRC, KC_NO, S(KC_5), SE_QUES, SE_AT, SE_EQL, SE_DLR, KC_BSPC, | ||
| 40 | KC_TRNS, SE_LCBR, SE_RCBR, SE_LPRN, SE_RPRN, KC_NO, SE_PLUS, S(KC_1), S(KC_2), S(KC_3), SE_AMPR, KC_QUOT, | ||
| 41 | KC_TRNS, M_TILD, M_CIRC, SE_LESS, SE_GRTR, KC_NO, SE_APOS, SE_SLSH, SE_BSLS, SE_ASTR, M_BTCK, KC_ENT, | ||
| 42 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
| 43 | ), | ||
| 44 | |||
| 45 | [_NAVIGATION] = LAYOUT_planck_2x2u( | ||
| 46 | KC_TRNS, KC_NO, CUT, COPY, PASTE, AUTOFILL,KC_NO, KC_HOME, KC_WH_D, KC_WH_U, KC_END, KC_NO, | ||
| 47 | KC_TRNS, KC_ACL0, KC_ACL1, KC_BTN2, KC_BTN1, KC_LCTL, KC_WH_L, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_WH_R, | ||
| 48 | KC_TRNS, KC_ACL2, KC_BTN4, KC_BTN3, KC_BTN5, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_LCTL, | ||
| 49 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
| 50 | ), | ||
| 51 | |||
| 52 | [_NUMPAD] = LAYOUT_planck_2x2u( | ||
| 53 | KC_TRNS, QUIT, WIN, MVWSL, MVWSR, CRYWS, TERM, KC_7, KC_8, KC_9, KC_COMM, RESET, | ||
| 54 | KC_TRNS, CS_TAB, C_TAB, PRVWS, NXTWS, I3MOD, OPEN, KC_4, KC_5, KC_6, KC_0, KC_NO, | ||
| 55 | KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, MOVWS, BROWSER, KC_1, KC_2, KC_3, KC_DOT, KC_NO, | ||
| 56 | QWE_COL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
| 57 | ), | ||
| 58 | |||
| 59 | }; | ||
| 60 | // clang-format on | ||
diff --git a/keyboards/planck/keymaps/mnil/readme.md b/keyboards/planck/keymaps/mnil/readme.md new file mode 100644 index 000000000..43c940961 --- /dev/null +++ b/keyboards/planck/keymaps/mnil/readme.md | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | # mnil's planck keymap | ||
| 2 | Read my user settings [here](../../../../users/mnil/readme.md) for more details. | ||
diff --git a/users/mnil/config.h b/users/mnil/config.h new file mode 100644 index 000000000..3547785ff --- /dev/null +++ b/users/mnil/config.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | /* Copyright 2021 Mats Nilsson | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #define MK_3_SPEED | ||
| 20 | #define MK_MOMENTARY_ACCEL | ||
| 21 | #define PERMISSIVE_HOLD | ||
diff --git a/users/mnil/mnil.c b/users/mnil/mnil.c new file mode 100644 index 000000000..11d5ee28d --- /dev/null +++ b/users/mnil/mnil.c | |||
| @@ -0,0 +1,146 @@ | |||
| 1 | /* Copyright 2021 Mats Nilsson | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include "mnil.h" | ||
| 18 | |||
| 19 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 20 | switch (keycode) { | ||
| 21 | case M_TILD: // ~ | ||
| 22 | if (record->event.pressed) { | ||
| 23 | tap_code16(RALT(KC_RBRC)); | ||
| 24 | tap_code(KC_SPC); | ||
| 25 | } else { | ||
| 26 | } | ||
| 27 | break; | ||
| 28 | case M_CIRC: // ^ | ||
| 29 | if (record->event.pressed) { | ||
| 30 | tap_code16(S(KC_RBRC)); | ||
| 31 | tap_code(KC_SPC); | ||
| 32 | } else { | ||
| 33 | } | ||
| 34 | break; | ||
| 35 | case M_BTCK: // ` | ||
| 36 | if (record->event.pressed) { | ||
| 37 | tap_code16(S(KC_EQL)); | ||
| 38 | tap_code(KC_SPC); | ||
| 39 | } else { | ||
| 40 | } | ||
| 41 | break; | ||
| 42 | case QWE_COL: // Swap default keymap layer | ||
| 43 | if (record->event.pressed) { | ||
| 44 | if (get_highest_layer(default_layer_state) == _COLEMAK) { | ||
| 45 | default_layer_set(1UL << _QWERTY); | ||
| 46 | } else { | ||
| 47 | default_layer_set(1UL << _COLEMAK); | ||
| 48 | } | ||
| 49 | } | ||
| 50 | break; | ||
| 51 | } | ||
| 52 | return true; | ||
| 53 | }; | ||
| 54 | |||
| 55 | // Tap Dance | ||
| 56 | // Determine the current tap dance state | ||
| 57 | int cur_dance(qk_tap_dance_state_t *state) { | ||
| 58 | if (state->count == 1) { | ||
| 59 | if (state->interrupted || !state->pressed) | ||
| 60 | return SINGLE_TAP; | ||
| 61 | else | ||
| 62 | return SINGLE_HOLD; | ||
| 63 | } else if (state->count == 2) { | ||
| 64 | if (state->interrupted) | ||
| 65 | return DOUBLE_SINGLE_TAP; | ||
| 66 | else if (state->pressed) | ||
| 67 | return DOUBLE_HOLD; | ||
| 68 | else | ||
| 69 | return DOUBLE_SINGLE_TAP; | ||
| 70 | } | ||
| 71 | if (state->count == 3) { | ||
| 72 | if (state->interrupted || !state->pressed) | ||
| 73 | return TRIPLE_TAP; | ||
| 74 | else | ||
| 75 | return TRIPLE_HOLD; | ||
| 76 | } else | ||
| 77 | return 8; | ||
| 78 | } | ||
| 79 | |||
| 80 | static tap ae_tap_state = {.is_press_action = true, .state = 0}; | ||
| 81 | |||
| 82 | void ae_finished(qk_tap_dance_state_t *state, void *user_data) { | ||
| 83 | ae_tap_state.state = cur_dance(state); | ||
| 84 | switch (ae_tap_state.state) { | ||
| 85 | case SINGLE_TAP: | ||
| 86 | register_code(KC_A); | ||
| 87 | break; | ||
| 88 | case SINGLE_HOLD: | ||
| 89 | tap_code(SE_AE); | ||
| 90 | break; | ||
| 91 | case DOUBLE_SINGLE_TAP: | ||
| 92 | tap_code(KC_A); | ||
| 93 | register_code(KC_A); | ||
| 94 | break; | ||
| 95 | } | ||
| 96 | } | ||
| 97 | |||
| 98 | void ae_reset(qk_tap_dance_state_t *state, void *user_data) { | ||
| 99 | switch (ae_tap_state.state) { | ||
| 100 | case SINGLE_TAP: | ||
| 101 | unregister_code(KC_A); | ||
| 102 | break; | ||
| 103 | case DOUBLE_SINGLE_TAP: | ||
| 104 | unregister_code(KC_A); | ||
| 105 | break; | ||
| 106 | } | ||
| 107 | ae_tap_state.state = 0; | ||
| 108 | } | ||
| 109 | |||
| 110 | static tap aa_tap_state = {.is_press_action = true, .state = 0}; | ||
| 111 | |||
| 112 | void aa_finished(qk_tap_dance_state_t *state, void *user_data) { | ||
| 113 | aa_tap_state.state = cur_dance(state); | ||
| 114 | switch (aa_tap_state.state) { | ||
| 115 | case SINGLE_TAP: | ||
| 116 | register_code(SE_OSLH); | ||
| 117 | break; | ||
| 118 | case SINGLE_HOLD: | ||
| 119 | register_code(SE_AA); | ||
| 120 | unregister_code(SE_AA); | ||
| 121 | break; | ||
| 122 | case DOUBLE_SINGLE_TAP: | ||
| 123 | tap_code(SE_OSLH); | ||
| 124 | register_code(SE_OSLH); | ||
| 125 | break; | ||
| 126 | } | ||
| 127 | } | ||
| 128 | |||
| 129 | void aa_reset(qk_tap_dance_state_t *state, void *user_data) { | ||
| 130 | switch (aa_tap_state.state) { | ||
| 131 | case SINGLE_TAP: | ||
| 132 | unregister_code(SE_OSLH); | ||
| 133 | break; | ||
| 134 | case DOUBLE_SINGLE_TAP: | ||
| 135 | unregister_code(SE_OSLH); | ||
| 136 | break; | ||
| 137 | } | ||
| 138 | aa_tap_state.state = 0; | ||
| 139 | } | ||
| 140 | |||
| 141 | // clang-format off | ||
| 142 | qk_tap_dance_action_t tap_dance_actions[] = { | ||
| 143 | [AAE] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, ae_finished, ae_reset, 250), | ||
| 144 | [OAA] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, aa_finished, aa_reset, 250) | ||
| 145 | }; | ||
| 146 | // clang-format on | ||
diff --git a/users/mnil/mnil.h b/users/mnil/mnil.h new file mode 100644 index 000000000..357acfe3c --- /dev/null +++ b/users/mnil/mnil.h | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | /* Copyright 2021 Mats Nilsson | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #include QMK_KEYBOARD_H | ||
| 20 | #include "keymap_swedish.h" | ||
| 21 | |||
| 22 | // Layers | ||
| 23 | enum layers { | ||
| 24 | _COLEMAK, | ||
| 25 | _QWERTY, | ||
| 26 | _SYMBOLS, | ||
| 27 | _NAVIGATION, | ||
| 28 | _NUMPAD, | ||
| 29 | }; | ||
| 30 | |||
| 31 | // Custom Keycodes | ||
| 32 | #define _NAV_SPC LT(_NAVIGATION, KC_SPC) // _NAVIGATION when held, SPACE when tapped | ||
| 33 | #define _SYM_ENT LT(_SYMBOLS, KC_ENT) // _SYMBOLS when held, ENTER when tapped | ||
| 34 | #define CTL_BSPC MT(MOD_LCTL, KC_BSPC) // CTRL when held, BACKSPACE when tapped | ||
| 35 | #define ALT_DEL MT(MOD_LALT, KC_DEL) // ALT when held, DELETE when tapped | ||
| 36 | #define SFT_TAB MT(MOD_LSFT, KC_TAB) // SHIFT when held, TAB when tapped | ||
| 37 | #define C_TAB C(KC_TAB) // CTRL+TAB | ||
| 38 | #define CS_TAB C(S(KC_TAB)) // SHIFT+CTRL+TAB | ||
| 39 | #define CUT C(KC_X) // CTRL+X | ||
| 40 | #define COPY C(KC_INS) // CTRL+INSERT | ||
| 41 | #define PASTE S(KC_INS) // SHIFT+INSERT | ||
| 42 | #define AUTOFILL C(S(KC_L)) // Bitwarden Autofill, CTRL+SHIFT+L | ||
| 43 | |||
| 44 | // i3 config | ||
| 45 | #define I3MOD KC_LGUI // $mod | ||
| 46 | #define OPEN G(KC_SPC) // $mod+SPACE | ||
| 47 | #define QUIT G(S(KC_Q)) // $mod+SHIFT+Q | ||
| 48 | #define WIN G(C(KC_SPC)) // $mod+CTRL+SPACE | ||
| 49 | #define BROWSER G(KC_ENTER) // $mod+ENTER | ||
| 50 | #define TERM G(S(KC_ENTER)) // $mod+CTRL+ENTER | ||
| 51 | #define NXTWS G(KC_TAB) // $mod+TAB | ||
| 52 | #define PRVWS G(S(KC_TAB)) // $mod+SHIFT+TAB | ||
| 53 | #define MOVWS G(KC_LSFT) // $mod+SHIFT+$X | ||
| 54 | #define CRYWS G(KC_LALT) // $mod+ALT+$X | ||
| 55 | #define MVWSL G(C(S(KC_LEFT))) // $mod+CTRL+SHIFT+LEFT | ||
| 56 | #define MVWSR G(C(S(KC_RGHT))) // $mod+CTRL+SHIFT+RIGHT | ||
| 57 | |||
| 58 | enum custom_keycodes { | ||
| 59 | M_TILD = SAFE_RANGE, // ~ | ||
| 60 | M_CIRC, // ^ | ||
| 61 | M_BTCK, // ` | ||
| 62 | QWE_COL, // Swaps default layer | ||
| 63 | }; | ||
| 64 | |||
| 65 | // Tap Dance | ||
| 66 | typedef struct { | ||
| 67 | bool is_press_action; | ||
| 68 | int state; | ||
| 69 | } tap; | ||
| 70 | |||
| 71 | // Define a type for as many tap dance states as you need | ||
| 72 | enum { | ||
| 73 | SINGLE_TAP = 1, | ||
| 74 | SINGLE_HOLD = 2, | ||
| 75 | DOUBLE_TAP = 3, | ||
| 76 | DOUBLE_HOLD = 4, | ||
| 77 | DOUBLE_SINGLE_TAP = 5, // send two single taps | ||
| 78 | TRIPLE_TAP = 6, | ||
| 79 | TRIPLE_HOLD = 7 | ||
| 80 | }; | ||
| 81 | |||
| 82 | enum { | ||
| 83 | AAE = 0, // a and ae | ||
| 84 | OAA, // o and aa | ||
| 85 | }; | ||
diff --git a/users/mnil/readme.md b/users/mnil/readme.md new file mode 100644 index 000000000..f688ea388 --- /dev/null +++ b/users/mnil/readme.md | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | # mnil's user settings | ||
| 2 | This keymap consist of four primary layers, `_COLEMAK`, `_SYMBOL`, `_NAVIGATION` and `_NUMPAD`. | ||
| 3 | Colemak layout for less finger travel distance and to reduce RSI. | ||
| 4 | The `_SYMBOL` layer is optimized for programming, specifically in `C++`. | ||
| 5 | Space and Enter do double duties as layer toggle on hold where the `_NUMPAD` is entered when both are held down. | ||
| 6 | `ALT+TAB` and `SHIFT+ALT+TAB` keys is implemented to register `ALT` and then `TAB` on each subsequent key press one leaves the `_NUMPAD`-layer. | ||
| 7 | The Swedish characters `åäöÅÄÖ` are added as a tap dances on top of the Colemak layer since they are rarely needed. | ||
| 8 | |||
| 9 | # License | ||
| 10 | Copyright 2021 Mats Nilsson matni403@gmail.com @mnil | ||
| 11 | |||
| 12 | This program is free software: you can redistribute it and/or modify | ||
| 13 | it under the terms of the GNU General Public License as published by | ||
| 14 | the Free Software Foundation, either version 2 of the License, or | ||
| 15 | (at your option) any later version. | ||
| 16 | |||
| 17 | This program is distributed in the hope that it will be useful, | ||
| 18 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 20 | GNU General Public License for more details. | ||
| 21 | |||
| 22 | You should have received a copy of the GNU General Public License | ||
| 23 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
diff --git a/users/mnil/rules.mk b/users/mnil/rules.mk new file mode 100644 index 000000000..22cebfaee --- /dev/null +++ b/users/mnil/rules.mk | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | SRC += mnil.c | ||
| 2 | MOUSEKEY_ENABLE = yes # Enable mouse keys | ||
| 3 | LTO_ENABLE = yes # Enable link time optimization | ||
| 4 | BACKLIGHT_ENABLE = no | ||
| 5 | CONSOLE_ENABLE = no | ||
| 6 | AUTO_SHIFT_ENABLE = no | ||
| 7 | TAP_DANCE_ENABLE = yes | ||
