diff options
Diffstat (limited to 'keyboards/mechwild/murphpad/keymaps/via/keymap.c')
| -rw-r--r-- | keyboards/mechwild/murphpad/keymaps/via/keymap.c | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/keyboards/mechwild/murphpad/keymaps/via/keymap.c b/keyboards/mechwild/murphpad/keymaps/via/keymap.c new file mode 100644 index 000000000..630b47f8c --- /dev/null +++ b/keyboards/mechwild/murphpad/keymaps/via/keymap.c | |||
| @@ -0,0 +1,138 @@ | |||
| 1 | /* Copyright 2021 Kyle McCreery | ||
| 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 | #include QMK_KEYBOARD_H | ||
| 17 | |||
| 18 | // Defines names for use in layer keycodes and the keymap | ||
| 19 | enum layer_names { | ||
| 20 | _BASE, | ||
| 21 | _FN1, | ||
| 22 | _FN2, | ||
| 23 | _FN3 | ||
| 24 | }; | ||
| 25 | |||
| 26 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 27 | /* Base */ | ||
| 28 | [_BASE] = LAYOUT( | ||
| 29 | KC_F1, KC_F2, KC_F3, KC_F4, | ||
| 30 | KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, | ||
| 31 | KC_P7, KC_P8, KC_P9, KC_PPLS, | ||
| 32 | KC_MUTE, KC_P4, KC_P5, KC_P6, KC_NO, | ||
| 33 | MO(_FN1), KC_P1, KC_P2, KC_P3, KC_PENT, | ||
| 34 | KC_BSPC, KC_P0, KC_NO, KC_PDOT, KC_NO, | ||
| 35 | |||
| 36 | _______, _______, _______ | ||
| 37 | |||
| 38 | ), | ||
| 39 | [_FN1] = LAYOUT( | ||
| 40 | _______, _______, _______, _______, | ||
| 41 | _______, _______, _______, _______, | ||
| 42 | RGB_HUD, RGB_SPI, RGB_HUI, _______, | ||
| 43 | _______, RGB_RMOD, RGB_TOG, RGB_MOD, KC_NO, | ||
| 44 | _______, RGB_VAD, RGB_SPD, RGB_VAI, _______, | ||
| 45 | _______, RGB_SAD, KC_NO, RGB_SAI, KC_NO, | ||
| 46 | |||
| 47 | _______, _______, _______ | ||
| 48 | |||
| 49 | ), | ||
| 50 | [_FN2] = LAYOUT( | ||
| 51 | _______, _______, _______, _______, | ||
| 52 | _______, _______, _______, _______, | ||
| 53 | _______, _______, _______, _______, | ||
| 54 | _______, _______, _______, _______, KC_NO, | ||
| 55 | _______, _______, _______, _______, _______, | ||
| 56 | _______, _______, _______, _______, KC_NO, | ||
| 57 | |||
| 58 | _______, _______, _______ | ||
| 59 | |||
| 60 | ), | ||
| 61 | [_FN3] = LAYOUT( | ||
| 62 | _______, _______, _______, _______, | ||
| 63 | _______, _______, _______, _______, | ||
| 64 | _______, _______, _______, _______, | ||
| 65 | _______, _______, _______, _______, KC_NO, | ||
| 66 | _______, _______, _______, _______, _______, | ||
| 67 | _______, _______, _______, _______, KC_NO, | ||
| 68 | |||
| 69 | _______, _______, _______ | ||
| 70 | |||
| 71 | ) | ||
| 72 | }; | ||
| 73 | |||
| 74 | #ifdef ENCODER_ENABLE | ||
| 75 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 76 | switch (index) { | ||
| 77 | case 0: | ||
| 78 | if (clockwise) { | ||
| 79 | tap_code(KC_VOLU); | ||
| 80 | } else { | ||
| 81 | tap_code(KC_VOLD); | ||
| 82 | } | ||
| 83 | break; | ||
| 84 | } | ||
| 85 | |||
| 86 | } | ||
| 87 | #endif | ||
| 88 | |||
| 89 | #ifdef OLED_DRIVER_ENABLE | ||
| 90 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||
| 91 | return OLED_ROTATION_270; // flips the display 270 degrees | ||
| 92 | } | ||
| 93 | |||
| 94 | static void render_logo(void) { // Render MechWild "MW" Logo | ||
| 95 | static const char PROGMEM logo_1[] = {0x8A, 0x8B, 0x8C, 0x8D, 0x00}; | ||
| 96 | static const char PROGMEM logo_2[] = {0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0x00}; | ||
| 97 | static const char PROGMEM logo_3[] = {0xCA, 0xCB, 0xCC, 0xCD, 0x00}; | ||
| 98 | static const char PROGMEM logo_4[] = {0x20, 0x8E, 0x8F, 0x90, 0x00}; | ||
| 99 | oled_set_cursor(0,0); | ||
| 100 | oled_write_P(logo_1, false); | ||
| 101 | oled_set_cursor(0,1); | ||
| 102 | oled_write_P(logo_2, false); | ||
| 103 | oled_set_cursor(0,2); | ||
| 104 | oled_write_P(logo_3, false); | ||
| 105 | oled_set_cursor(0,3); | ||
| 106 | oled_write_P(logo_4, false); | ||
| 107 | } | ||
| 108 | |||
| 109 | void oled_task_user(void) { | ||
| 110 | render_logo(); | ||
| 111 | oled_set_cursor(0,6); | ||
| 112 | |||
| 113 | oled_write_ln_P(PSTR("Layer"), false); | ||
| 114 | |||
| 115 | switch (get_highest_layer(layer_state)) { | ||
| 116 | case _BASE: | ||
| 117 | oled_write_ln_P(PSTR("Base"), false); | ||
| 118 | break; | ||
| 119 | case _FN1: | ||
| 120 | oled_write_ln_P(PSTR("FN 1"), false); | ||
| 121 | break; | ||
| 122 | case _FN2: | ||
| 123 | oled_write_ln_P(PSTR("FN 2"), false); | ||
| 124 | break; | ||
| 125 | case _FN3: | ||
| 126 | oled_write_ln_P(PSTR("FN 3"), false); | ||
| 127 | break; | ||
| 128 | default: | ||
| 129 | oled_write_ln_P(PSTR("Undef"), false); | ||
| 130 | } | ||
| 131 | oled_write_ln_P(PSTR(""), false); | ||
| 132 | // Host Keyboard LED Status | ||
| 133 | led_t led_state = host_keyboard_led_state(); | ||
| 134 | oled_write_ln_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); | ||
| 135 | oled_write_ln_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); | ||
| 136 | oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); | ||
| 137 | } | ||
| 138 | #endif \ No newline at end of file | ||
