diff options
| author | stanrc85 <47038504+stanrc85@users.noreply.github.com> | 2021-06-19 22:12:39 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-19 19:12:39 -0700 |
| commit | d456963177b9d3639c2eb14b932d2e601b04973f (patch) | |
| tree | 2604d6cd0bd882caf5650f31c85f9b77db3b3a86 | |
| parent | 4dddcb4f0300f79d8fbfc462ff8d6b360e99989e (diff) | |
| download | qmk_firmware-d456963177b9d3639c2eb14b932d2e601b04973f.tar.gz qmk_firmware-d456963177b9d3639c2eb14b932d2e601b04973f.zip | |
[Keymap] Add stanrc85 Abasic keymap (#13180)
3 files changed, 140 insertions, 0 deletions
diff --git a/keyboards/kiwikey/wanderland/keymaps/stanrc85/config.h b/keyboards/kiwikey/wanderland/keymaps/stanrc85/config.h new file mode 100644 index 000000000..9a29d5b8e --- /dev/null +++ b/keyboards/kiwikey/wanderland/keymaps/stanrc85/config.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | /* Copyright 2021 Stanrc85 | ||
| 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 | #pragma once | ||
| 17 | |||
| 18 | #define OLED_FADE_OUT | ||
diff --git a/keyboards/kiwikey/wanderland/keymaps/stanrc85/keymap.c b/keyboards/kiwikey/wanderland/keymaps/stanrc85/keymap.c new file mode 100644 index 000000000..a2f65ae5e --- /dev/null +++ b/keyboards/kiwikey/wanderland/keymaps/stanrc85/keymap.c | |||
| @@ -0,0 +1,121 @@ | |||
| 1 | /* Copyright 2021 Stanrc85 | ||
| 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 | #include "stanrc85.h" | ||
| 18 | |||
| 19 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 20 | [_QWERTY] = LAYOUT_alice( | ||
| 21 | KC_ESC, KC_GRV, 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, | ||
| 22 | KC_PGUP, 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_BSLS, | ||
| 23 | KC_PGDN, KC_CTLE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, | ||
| 24 | _______, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN2_60), | ||
| 25 | KC_LCTL, KC_LALT, LT_BPCF, KC_LGUI, LT_SPCF, TD_TWIN, TD_TCTL | ||
| 26 | ), | ||
| 27 | |||
| 28 | [_DEFAULT] = LAYOUT_alice( | ||
| 29 | KC_ESC, KC_GRV, 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, | ||
| 30 | KC_PGUP, 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_BSLS, | ||
| 31 | KC_PGDN, 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_ENT, | ||
| 32 | _______, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN2_60), | ||
| 33 | KC_LCTL, KC_LALT, KC_SPC, MO(_FN1_60), KC_SPC, KC_RALT, KC_RCTL | ||
| 34 | ), | ||
| 35 | |||
| 36 | [_FN1_60] = LAYOUT_alice( | ||
| 37 | _______, KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, | ||
| 38 | _______, _______, _______, CA_QUOT, _______, CA_SCLN, KC_VOLU, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PSCR, _______, _______, KC_INS, | ||
| 39 | _______, KC_CAPS, _______, _______, KC_LCTL, KC_LSFT, KC_VOLD, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, | ||
| 40 | _______, _______, KC_RDP, _______, _______, _______, _______, _______, _______, KC_WBAK, KC_WFWD, _______, _______, _______, _______, | ||
| 41 | _______, _______, _______, _______, _______, _______, _______ | ||
| 42 | ), | ||
| 43 | |||
| 44 | [_FN2_60] = LAYOUT_alice( | ||
| 45 | BL_TOGG, RGB_TOG, RGB_MOD, RGB_VAD, RGB_VAI, RGB_SAI, RGB_HUD, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, | ||
| 46 | BL_INC, VLK_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, | ||
| 47 | BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MAKE, | ||
| 48 | _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, | ||
| 49 | _______, _______, _______, _______, _______, _______, TG(_DEFAULT) | ||
| 50 | ) | ||
| 51 | }; | ||
| 52 | |||
| 53 | #ifdef OLED_DRIVER_ENABLE | ||
| 54 | void oled_task_user(void) { | ||
| 55 | static const char PROGMEM qmk_logo[] = { | ||
| 56 | 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, | ||
| 57 | 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, | ||
| 58 | 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00 | ||
| 59 | }; | ||
| 60 | |||
| 61 | switch (get_highest_layer(layer_state)) { | ||
| 62 | case _QWERTY: | ||
| 63 | oled_write_P(qmk_logo, false); | ||
| 64 | break; | ||
| 65 | case _DEFAULT: | ||
| 66 | oled_write_ln_P(PSTR(" Layer: Game\n\n"), false); | ||
| 67 | break; | ||
| 68 | case _FN1_60: | ||
| 69 | oled_write_ln_P(PSTR(" Layer: FN\n\n"), false); | ||
| 70 | break; | ||
| 71 | case _FN2_60: | ||
| 72 | oled_write_ln_P(PSTR(" Layer: RGB\n\n"), false); | ||
| 73 | break; | ||
| 74 | default: | ||
| 75 | // Or use the write_ln shortcut over adding '\n' to the end of your string | ||
| 76 | oled_write_ln_P(PSTR("Undefined"), false); | ||
| 77 | } | ||
| 78 | |||
| 79 | // Host Keyboard LED Status | ||
| 80 | led_t led_state = host_keyboard_led_state(); | ||
| 81 | oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); | ||
| 82 | oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); | ||
| 83 | oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); | ||
| 84 | } | ||
| 85 | #endif | ||
| 86 | |||
| 87 | // Backlight timeout feature | ||
| 88 | #define BACKLIGHT_TIMEOUT 20 // in minutes | ||
| 89 | static uint16_t idle_timer = 0; | ||
| 90 | static uint8_t halfmin_counter = 0; | ||
| 91 | static bool led_on = true; | ||
| 92 | static bool rgb_on = true; | ||
| 93 | |||
| 94 | void matrix_scan_user(void) { | ||
| 95 | // idle_timer needs to be set one time | ||
| 96 | if (idle_timer == 0) idle_timer = timer_read(); | ||
| 97 | if ( (led_on && timer_elapsed(idle_timer) > 30000) || (rgb_on && timer_elapsed(idle_timer) > 30000)) { | ||
| 98 | halfmin_counter++; | ||
| 99 | idle_timer = timer_read(); | ||
| 100 | } | ||
| 101 | |||
| 102 | if ( (led_on && halfmin_counter >= BACKLIGHT_TIMEOUT * 2) || (rgb_on && halfmin_counter >= BACKLIGHT_TIMEOUT * 2)) { | ||
| 103 | rgblight_disable_noeeprom(); | ||
| 104 | led_on = false; | ||
| 105 | rgb_on = false; | ||
| 106 | halfmin_counter = 0; | ||
| 107 | } | ||
| 108 | }; | ||
| 109 | |||
| 110 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | ||
| 111 | if (record->event.pressed) { | ||
| 112 | if (led_on == false || rgb_on == false ) { | ||
| 113 | rgblight_enable_noeeprom(); | ||
| 114 | led_on = true; | ||
| 115 | rgb_on = true; | ||
| 116 | } | ||
| 117 | idle_timer = timer_read(); | ||
| 118 | halfmin_counter = 0; | ||
| 119 | } | ||
| 120 | return true; | ||
| 121 | } | ||
diff --git a/keyboards/kiwikey/wanderland/keymaps/stanrc85/rules.mk b/keyboards/kiwikey/wanderland/keymaps/stanrc85/rules.mk new file mode 100644 index 000000000..c58266213 --- /dev/null +++ b/keyboards/kiwikey/wanderland/keymaps/stanrc85/rules.mk | |||
| @@ -0,0 +1 @@ | |||
| OLED_DRIVER_ENABLE = yes | |||
