diff options
| author | Jordan Duabe <jordan.duabe@gmail.com> | 2021-09-18 14:52:53 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-17 23:52:53 -0700 |
| commit | d51bb76ec96c35f3b5494f8dd0ecb2611dccd3df (patch) | |
| tree | b2f07dd4879264b212407f6419d8511e45e2be7c /keyboards/sofle | |
| parent | 09b66c06d4fa0f2db1340e9f9b89ab27235bb500 (diff) | |
| download | qmk_firmware-d51bb76ec96c35f3b5494f8dd0ecb2611dccd3df.tar.gz qmk_firmware-d51bb76ec96c35f3b5494f8dd0ecb2611dccd3df.zip | |
[Keymap] Add 'j4ckofalltrades' keymap for sofle/rev1 (#14446)
Diffstat (limited to 'keyboards/sofle')
| -rw-r--r-- | keyboards/sofle/keymaps/j4ckofalltrades/encoder.c | 37 | ||||
| -rw-r--r-- | keyboards/sofle/keymaps/j4ckofalltrades/keymap.c | 85 | ||||
| -rw-r--r-- | keyboards/sofle/keymaps/j4ckofalltrades/oled.c | 76 | ||||
| -rw-r--r-- | keyboards/sofle/keymaps/j4ckofalltrades/readme.md | 19 | ||||
| -rw-r--r-- | keyboards/sofle/keymaps/j4ckofalltrades/rules.mk | 6 |
5 files changed, 223 insertions, 0 deletions
diff --git a/keyboards/sofle/keymaps/j4ckofalltrades/encoder.c b/keyboards/sofle/keymaps/j4ckofalltrades/encoder.c new file mode 100644 index 000000000..bd328739e --- /dev/null +++ b/keyboards/sofle/keymaps/j4ckofalltrades/encoder.c | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | /* Copyright 2021 Jordan Duabe | ||
| 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 | #ifdef ENCODER_ENABLE | ||
| 18 | # include QMK_KEYBOARD_H | ||
| 19 | |||
| 20 | bool encoder_update_user(uint8_t index, bool clockwise) { | ||
| 21 | if (index == 0) { | ||
| 22 | if (clockwise) { | ||
| 23 | tap_code_delay(KC_VOLU, 10); | ||
| 24 | } else { | ||
| 25 | tap_code_delay(KC_VOLD, 10); | ||
| 26 | } | ||
| 27 | } else if (index == 1) { | ||
| 28 | if (clockwise) { | ||
| 29 | tap_code(KC_PGDOWN); | ||
| 30 | } else { | ||
| 31 | tap_code(KC_PGUP); | ||
| 32 | } | ||
| 33 | } | ||
| 34 | return true; | ||
| 35 | } | ||
| 36 | |||
| 37 | #endif | ||
diff --git a/keyboards/sofle/keymaps/j4ckofalltrades/keymap.c b/keyboards/sofle/keymaps/j4ckofalltrades/keymap.c new file mode 100644 index 000000000..e7d03161c --- /dev/null +++ b/keyboards/sofle/keymaps/j4ckofalltrades/keymap.c | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | /* Copyright 2021 Jordan Duabe | ||
| 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 QMK_KEYBOARD_H | ||
| 18 | |||
| 19 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 20 | /* | ||
| 21 | * QWERTY | ||
| 22 | * ,-----------------------------------------. ,-----------------------------------------. | ||
| 23 | * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` | | ||
| 24 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 25 | * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bspc | | ||
| 26 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 27 | * | Esc | A | S | D | F | G |-------. ,-------| H | J | K | L | ; | ' | | ||
| 28 | * |------+------+------+------+------+------| TO(2) | | TO(1) |------+------+------+------+------+------| | ||
| 29 | * |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / |RShift| | ||
| 30 | * `-----------------------------------------/ / \ \-----------------------------------------' | ||
| 31 | * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI | | ||
| 32 | * | | | | |/ / \ \ | | | | | | ||
| 33 | * `----------------------------------' '------''---------------------------' | ||
| 34 | */ | ||
| 35 | |||
| 36 | [0] = LAYOUT( | ||
| 37 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, | ||
| 38 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | ||
| 39 | MT(MOD_LCTL, KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
| 40 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, TO(2), TO(1), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, | ||
| 41 | KC_LGUI, KC_LALT, KC_LCTRL, MO(2), KC_ENT, KC_SPC, MO(1), KC_RCTRL, KC_RALT, KC_RGUI | ||
| 42 | ), | ||
| 43 | /* RAISE | ||
| 44 | * ,-----------------------------------------. ,-----------------------------------------. | ||
| 45 | * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | | ||
| 46 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 47 | * | Tab | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | F12 | | ||
| 48 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 49 | * | Esc | ! | @ | # | $ | % |-------. ,-------| ^ | & | * | ( | ) | | | | ||
| 50 | * |------+------+------+------+------+------| TO(2) | | TO(1) |------+------+------+------+------+------| | ||
| 51 | * |LShift| = | - | + | { | } |-------| |-------| [ | ] | ; | : | \ | Shift| | ||
| 52 | * `-----------------------------------------/ / \ \-----------------------------------------' | ||
| 53 | * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI | | ||
| 54 | * | | | | |/ / \ \ | | | | | | ||
| 55 | * `----------------------------------' '------''---------------------------' | ||
| 56 | */ | ||
| 57 | [1] = LAYOUT( | ||
| 58 | _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, | ||
| 59 | _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_F12, | ||
| 60 | _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, | ||
| 61 | _______, KC_EQL, KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, _______, _______, KC_LBRC, KC_RBRC, KC_SCLN, KC_COLN, KC_BSLS, _______, | ||
| 62 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 63 | ), | ||
| 64 | /* LOWER | ||
| 65 | * ,----------------------------------------. ,-----------------------------------------. | ||
| 66 | * | | Pscr | Slck |Pause | | | | | | | | | | | ||
| 67 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 68 | * | Tab | Ins | Home | PgUp | | | | | | | | | | | ||
| 69 | * |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
| 70 | * | Esc | Del | End | PgDn | | |-------. ,-------| Left | Down | Up | Right | | | | ||
| 71 | * |------+------+------+------+------+------| TO(2) | | TO(1) |------+------+------+------+------+------| | ||
| 72 | * |Shift | Undo | Cut | Copy | Paste| |-------| |-------| | | | | | | | ||
| 73 | * `-----------------------------------------/ / \ \-----------------------------------------' | ||
| 74 | * | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI | | ||
| 75 | * | | | | |/ / \ \ | | | | | | ||
| 76 | * `----------------------------------' '------''---------------------------' | ||
| 77 | */ | ||
| 78 | [2] = LAYOUT( | ||
| 79 | _______, KC_PSCR, KC_SLCK, KC_PAUSE, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 80 | _______, KC_INS, KC_HOME, KC_PGUP, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, | ||
| 81 | _______, KC_DEL, KC_END, KC_PGDN, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, XXXXXXX, XXXXXXX, | ||
| 82 | _______, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, XXXXXXX, _______, _______, XXXXXXX, _______, XXXXXXX, _______, XXXXXXX, _______, | ||
| 83 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 84 | ) | ||
| 85 | }; | ||
diff --git a/keyboards/sofle/keymaps/j4ckofalltrades/oled.c b/keyboards/sofle/keymaps/j4ckofalltrades/oled.c new file mode 100644 index 000000000..46c791b05 --- /dev/null +++ b/keyboards/sofle/keymaps/j4ckofalltrades/oled.c | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | /* Copyright 2021 Jordan Duabe | ||
| 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 | #ifdef OLED_ENABLE | ||
| 18 | # include QMK_KEYBOARD_H | ||
| 19 | |||
| 20 | static void render_logo(void) { | ||
| 21 | static const char PROGMEM qmk_logo[] = { | ||
| 22 | 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, | ||
| 23 | 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, | ||
| 24 | 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0 | ||
| 25 | }; | ||
| 26 | |||
| 27 | oled_write_P(qmk_logo, false); | ||
| 28 | } | ||
| 29 | |||
| 30 | static void print_status_narrow(void) { | ||
| 31 | oled_write_P(PSTR("Sofle"), false); | ||
| 32 | oled_write_P(PSTR("\n\n\n"), false); | ||
| 33 | // Print current mode | ||
| 34 | switch (get_highest_layer(layer_state)) { | ||
| 35 | case 0: | ||
| 36 | oled_write_ln_P(PSTR("Qwrt"), false); | ||
| 37 | break; | ||
| 38 | default: | ||
| 39 | oled_write_P(PSTR("Mod\n"), false); | ||
| 40 | break; | ||
| 41 | } | ||
| 42 | oled_write_P(PSTR("\n\n"), false); | ||
| 43 | // Print current layer | ||
| 44 | oled_write_ln_P(PSTR("LAYER"), false); | ||
| 45 | switch (get_highest_layer(layer_state)) { | ||
| 46 | case 0: | ||
| 47 | oled_write_P(PSTR("Base\n"), false); | ||
| 48 | break; | ||
| 49 | case 1: | ||
| 50 | oled_write_P(PSTR("Raise"), false); | ||
| 51 | break; | ||
| 52 | case 2: | ||
| 53 | oled_write_P(PSTR("Lower"), false); | ||
| 54 | break; | ||
| 55 | default: | ||
| 56 | oled_write_ln_P(PSTR("Undef"), false); | ||
| 57 | } | ||
| 58 | oled_write_P(PSTR("\n\n"), false); | ||
| 59 | } | ||
| 60 | |||
| 61 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||
| 62 | if (is_keyboard_master()) { | ||
| 63 | return OLED_ROTATION_270; | ||
| 64 | } | ||
| 65 | return rotation; | ||
| 66 | } | ||
| 67 | |||
| 68 | void oled_task_user(void) { | ||
| 69 | if (is_keyboard_master()) { | ||
| 70 | print_status_narrow(); | ||
| 71 | } else { | ||
| 72 | render_logo(); | ||
| 73 | } | ||
| 74 | } | ||
| 75 | |||
| 76 | #endif | ||
diff --git a/keyboards/sofle/keymaps/j4ckofalltrades/readme.md b/keyboards/sofle/keymaps/j4ckofalltrades/readme.md new file mode 100644 index 000000000..bb232ef62 --- /dev/null +++ b/keyboards/sofle/keymaps/j4ckofalltrades/readme.md | |||
| @@ -0,0 +1,19 @@ | |||
| 1 |  | ||
| 2 | |||
| 3 | # Via-compatible custom keymap for Sofle | ||
| 4 | |||
| 5 | Modified version of default Via-compatible keymap with focus on adding a standard navigation cluster layer plus some | ||
| 6 | Vim-inspired features e.g. soft escape (Esc when held, Ctrl when tapped), using 'h', 'j', 'k', 'l' as arrow keys. | ||
| 7 | |||
| 8 | ## Layout | ||
| 9 | |||
| 10 | View in [Keyboard Layout Editor](http://www.keyboard-layout-editor.com/#/gists/a1f6519e723ad81ca151741b53a28b80) | ||
| 11 | |||
| 12 | ## Features | ||
| 13 | |||
| 14 | - Via support | ||
| 15 | - Mode for soft escape (`Esc` when tapped, `Ctrl` when held) | ||
| 16 | - Vim-style navigation (`h` `j` `k` `l` as arrow keys) | ||
| 17 | - Mode for standard navigation cluster | ||
| 18 | - Toggling between layers when encoders are pressed | ||
| 19 | - Left encoder controls `VOLUP`/`VOLDOWN`. Right encoder `PGUP`/`PGDN`. | ||
diff --git a/keyboards/sofle/keymaps/j4ckofalltrades/rules.mk b/keyboards/sofle/keymaps/j4ckofalltrades/rules.mk new file mode 100644 index 000000000..dc95fd5b7 --- /dev/null +++ b/keyboards/sofle/keymaps/j4ckofalltrades/rules.mk | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | CONSOLE_ENABLE = no | ||
| 2 | EXTRAKEY_ENABLE = yes | ||
| 3 | VIA_ENABLE = yes | ||
| 4 | LTO_ENABLE = yes | ||
| 5 | |||
| 6 | SRC += oled.c encoder.c | ||
