diff options
author | James Smith <bronzegears@gmail.com> | 2021-09-22 00:18:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-21 21:18:25 -0700 |
commit | 43e88f34aa2587b16ca3f344ae7c40e2dcb5b622 (patch) | |
tree | 872dc0bb63e18e5b9282957aa537d910e1e36666 /keyboards/ein_60/keymaps | |
parent | 208ea0e18cc6725c173e106a88528fb0576f3ce6 (diff) |
[Keyboard] add ein_60 (#14398)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'keyboards/ein_60/keymaps')
-rw-r--r-- | keyboards/ein_60/keymaps/default/keymap.c | 208 | ||||
-rw-r--r-- | keyboards/ein_60/keymaps/default/readme.md | 3 | ||||
-rw-r--r-- | keyboards/ein_60/keymaps/default/rules.mk | 4 | ||||
-rw-r--r-- | keyboards/ein_60/keymaps/klackygears/config.h | 28 | ||||
-rw-r--r-- | keyboards/ein_60/keymaps/klackygears/keymap.c | 176 | ||||
-rw-r--r-- | keyboards/ein_60/keymaps/klackygears/readme.md | 1 | ||||
-rw-r--r-- | keyboards/ein_60/keymaps/klackygears/rules.mk | 8 | ||||
-rw-r--r-- | keyboards/ein_60/keymaps/ledtest/keymap.c | 207 | ||||
-rw-r--r-- | keyboards/ein_60/keymaps/ledtest/readme.md | 1 | ||||
-rw-r--r-- | keyboards/ein_60/keymaps/ledtest/rules.mk | 4 |
10 files changed, 640 insertions, 0 deletions
diff --git a/keyboards/ein_60/keymaps/default/keymap.c b/keyboards/ein_60/keymaps/default/keymap.c new file mode 100644 index 0000000000..3984dabcbf --- /dev/null +++ b/keyboards/ein_60/keymaps/default/keymap.c @@ -0,0 +1,208 @@ +/* Copyright 2021 klackygears + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include QMK_KEYBOARD_H + +enum layer_names { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _FUNCTION, +}; + +enum custom_keycodes { + RGBRST = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. ,------. ,----------------------------------------. + * | Tab | Q | W | E | R | T | | Mute | | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | Func | A | S | D | F | G | | H | J | K | L | ; | Enter| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / | ' | + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | Ctrl | ` | GUI | Alt |Lower |Space | |Space | |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MUTE, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + MO(_FUNCTION), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, + KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, KC_SPC, KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + /* Lower + * ,-----------------------------------------. ,------. ,-----------------------------------------. + * | Esc | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | F1 | F2 | F3 | F4 | F5 | F6 | | | _ | + | { | } |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | F7 | F8 | F9 | F10 | F11 | F12 | | | | | Mute | | | | + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | | | | |Lower | Bksp | | | | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_LOWER] = LAYOUT( + KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_MUTE, _______, KC_PIPE, + _______, _______, _______, _______, _______, KC_BSPC, _______, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + /* Raise + * ,-----------------------------------------. ,------. ,-----------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | | 4 | 5 | 6 | + | F5 | | F6 | - | = | [ | ] |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Enter | 7 | 8 | 9 | - | F11 | | F12 |ISO # |ISO / | Mute | | \ | + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | | , | 0 | . |Lower | Bksp | | | | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_RAISE] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, KC_4, KC_5, KC_6, KC_PLUS, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, + KC_ENT, KC_7, KC_8, KC_9, KC_MINS, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_MUTE, _______, KC_BSLS, + _______, KC_COMM, KC_0, KC_DOT, _______, KC_BSPC, _______, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + /* Adjust (Lower + Raise) + * ,-----------------------------------------. ,------. ,-----------------------------------------. + * | | | | | | | | | |RGBRST|RGBMOD|RGBVAI|RGBSAI|RGBHUI| | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | | | | | | | | |RGBRMO|RGBVAD|RGBSAD|RGBHUD|RGBTOG| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | |BLSTEP| + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | | | | | | | | | | | | | | | RESET| + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_ADJUST] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, RGBRST, RGB_MOD, RGB_VAI, RGB_SAI, RGB_HUI, _______, + _______, _______, _______, _______, _______, _______, _______, RGB_RMOD,RGB_VAD, RGB_SAD, RGB_HUD, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_STEP, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET + ), + /* Function + * ,-----------------------------------------. ,------. ,-----------------------------------------. + * | | | | | | | | | | | | Up | | | | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | | | | | | | | | Left | Down |Right | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Caps | | | | | | | | | | | | | + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | | | | | | | | | | | | | | | | + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_FUNCTION] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +#ifdef OLED_ENABLE + + +static void render_ein60_logo(void) { + static const char PROGMEM ein60_logo[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 11,251,139,139,139,139,139,139,139,139,139,139,139, 11, 15, 0,240,240, 16,240, 0,240,240, 16,240,224,192,128, 0, 0, 0, 0,240, 16,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254,255, 11,251,139,139,139,139,139,139,139,139,139,139,139,143,128, 0, 0, 0, 0,254,255, 11,251, 11, 11, 11, 11,139,203,235,123,187,219,235,251,255, 7,252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 4,253,197,197,197,197,197,197,197,197,197,197,199,192,192, 0,255,255, 0,255, 0,255,255, 0,254, 13, 27, 55,111,222,188,120,255, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0,255,197,197,197,197,197,197,197,197,197,197,253,253,255,131,254, 0, 0,255,255, 0,255,184,220,238,247,219,205,198,195,193,192,255,255,255,128,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 3, 3, 2, 3, 0, 3, 3, 2, 3, 0, 0, 0, 0, 0, 1, 3, 2, 2, 3, 0, 8, 28, 20, 20, 20, 20, 20, 28, 8, 0, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + oled_write_raw_P(ein60_logo, sizeof(ein60_logo)); + } + +static void render_status(void) { + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + switch (get_highest_layer(layer_state)) { + case _QWERTY: + oled_write_P(PSTR("Default\n"), false); + break; + case _LOWER: + oled_write_P(PSTR("Lower\n"), false); + break; + case _RAISE: + oled_write_P(PSTR("Raise\n"), false); + break; + case _ADJUST: + oled_write_P(PSTR("Adjust\n"), false); + break; + case _FUNCTION: + oled_write_P(PSTR("FN\n"), false); + break; + default: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_ln_P(PSTR("Undefined"), false); + } + + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); + + oled_set_cursor(1,2); +} + +void oled_task_user(void) { + + render_status(); + oled_write_ln_P(PSTR(""), false); + render_ein60_logo(); +} +#endif + + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { /* Second encoder */ + if (clockwise) { + tap_code(KC_DOWN); + } else { + tap_code(KC_UP); + } + } + return true; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + } + #endif + break; + } + return true; +} diff --git a/keyboards/ein_60/keymaps/default/readme.md b/keyboards/ein_60/keymaps/default/readme.md new file mode 100644 index 0000000000..8f9aab0435 --- /dev/null +++ b/keyboards/ein_60/keymaps/default/readme.md @@ -0,0 +1,3 @@ +# The default keymap for EIN_60. + +It utilizes a nearly identical layout as the Plank. The OLED is enabled, rotary encoders are enabled, and the LEDs are enabled with RGB Matrix. You'll need to alter the rules.mk file in your own keymap to change this or simply cut the jumper pad with a hobby knife to disconnect them completely. There is an option to install a KELIKING KLJ-1102 speaker and enable with "AUDIO_ENABLE = yes" in your rules.mk file. diff --git a/keyboards/ein_60/keymaps/default/rules.mk b/keyboards/ein_60/keymaps/default/rules.mk new file mode 100644 index 0000000000..04b133f6a0 --- /dev/null +++ b/keyboards/ein_60/keymaps/default/rules.mk @@ -0,0 +1,4 @@ +# Build Options +# change yes to no to disable +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +RGB_MATRIX_ENABLE = yes # Enable for pretty RGB matrix effects diff --git a/keyboards/ein_60/keymaps/klackygears/config.h b/keyboards/ein_60/keymaps/klackygears/config.h new file mode 100644 index 0000000000..d3b1c7b4d9 --- /dev/null +++ b/keyboards/ein_60/keymaps/klackygears/config.h @@ -0,0 +1,28 @@ +/* Copyright 2021 klackygears + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#pragma once + + + +#define PERMISSIVE_HOLD +#define TAPPING_TERM 150 +#define IGNORE_MOD_TAP_INTERRUPT + + +#ifdef RGB_MATRIX_ENABLE + #define RGB_MATRIX_KEYPRESSES +#endif diff --git a/keyboards/ein_60/keymaps/klackygears/keymap.c b/keyboards/ein_60/keymaps/klackygears/keymap.c new file mode 100644 index 0000000000..ea1d77dea7 --- /dev/null +++ b/keyboards/ein_60/keymaps/klackygears/keymap.c @@ -0,0 +1,176 @@ +/* Copyright 2020 klackygears + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include QMK_KEYBOARD_H +#include "klackygears.h" +#include "stdio.h" + +//For an explanation of what's going on here with the keymap wrappers, check out drashna's user folder. +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_WINBASE] = LAYOUT_wrapper( + KC_ESC, _______________DVORAK_L1___________________, KC_MUTE, _______________DVORAK_R1___________________, KC_BSPC, + AU_TOG, _______________DVORAK_L2___________________, _______________DVORAK_R2___________________, RGB_TOG, + CK_TOGG, _______________WINDVK_L3___________________, _______________WINDVK_R3___________________, RGB_MOD, + KC_1, KC_2, KC_3, ________WIN_THUMB_L______, KC_SPC, ________WIN_THUMB_R______, KC_1, KC_2, KC_GAMER + ), + [_MACBASE] = LAYOUT_wrapper( + KC_ESC, _______________DVORAK_L1___________________, _______, _______________DVORAK_R1___________________, KC_BSPC, + RGB_TOG, _______________DVORAK_L2___________________, _______________DVORAK_R2___________________, RGB_TOG, + RGB_MOD, _______________MACDVK_L3___________________, _______________MACDVK_R3___________________, RGB_MOD, + _______, _______, _______, ________MAC_THUMB_L______, _______, ________MAC_THUMB_R______, _______, _______, _______ + ), + [_QWERTY] = LAYOUT_wrapper( + KC_ESC, _________________COLEMAK_L1________________, KC_ESC, _________________QWERTY_R1_________________, KC_BSPC, + KC_CAPS, _________________COLEMAK_L2________________, _________________QWERTY_R2_________________, KC_ENT, + KC_LSFT, _________________COLEMAK_L3________________, _________________QWERTY_R3_________________, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, _______, MO(_MNMB), MO(_SYMB), KC_SPC, MO(_SYMB), MO(_MNMB), KC_RGUI,_______, MO(_MDIA), MO(_FUNC) + ), + + //Borderlands + [_GAMER] = LAYOUT_wrapper( + KC_ESC, KC_R, KC_G, KC_W, KC_E, KC_1, _______, _________________RGB_1_____________________, KC_WINBASE, + KC_TAB, KC_V, KC_A, KC_S, KC_D, KC_2, _________________RGB_2_____________________, _______, + KC_C, KC_I, KC_F, KC_Q, KC_4, KC_3, _________________MEDIA_____________________, _______, + KC_Z, KC_X, KC_K, KC_LCTL, KC_LSFT, KC_SPC, KC_SPC, KC_F12, KC_P, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT + ), + + [_SYMB] = LAYOUT_wrapper( + _______, _________________PUNC_L1_ALT_______________, _______, _________________PUNC_R1___________________, _______, + _______, _________________PUNC_L3___________________, _________________PUNC_R2___________________, _______, + RGB_MOD, _________________PUNC_L3_ALT_______________, _________________PUNC_R3___________________, _______, + _______, _______, KC_NLCK, KC_SLCK, KC_DEL, _______, _______, _______, KC_CAPS, _______, _______, _______, _______ + ), + + [_FUNC] = LAYOUT_wrapper( + _______, _____________FUNC_L1_______________________, _______, _______, _____________FUNC_1_______________, _______, + _______, ________MAC_MISSION_CTRL__________, LGUI(KC_L), _______, _____________FUNC_2_______________, _______, + RGB_MOD, _____________FUNC_L3_______________________, _______, _____________FUNC_3_______________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_CAPS, _______, _______, _______, _______ + ), + + [_MNMB] = LAYOUT_wrapper( + _______, _________________MACNAV_L1_________________, _______, _________________NUMB_R1___________________, _______, + _______, _________________MACNAV_L2_________________, _________________NUMB_R2___________________, _______, + RGB_MOD, _________________MACNAV_L3_________________, _________________NUMB_R3_MAC_______________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, RSFT_T(KC_ENT), KC_RSFT, _______, _______, _______ + ), + + + [_NUMB] = LAYOUT_wrapper( + _______, _________________WINNAV_L1_________________, _______, _________________NUMB_R1___________________, _______, + _______, _________________WINNAV_L2_________________, _________________NUMB_R2___________________, _______, + RGB_MOD, _________________WINNAV_L3_________________, _________________NUMB_R3_WIN_______________, _______, + _______, _______, _______, TO(_WINBASE), _______, _______, _______, _______, RSFT_T(KC_ENT), KC_RSFT, _______, _______, _______ + ), + + [_MDIA] = LAYOUT_wrapper( + _______, _________________LYOUT_____________________, _______, _________________RGB_1_____________________, RGB_TOG, + _______, MU_TOG, _______, _______, _______, CK_UP, _________________RGB_2_____________________, _______, + RGB_MOD, MU_MOD, MU_TOG, CK_TOGG, CK_RST, CK_DOWN, _________________MEDIA_____________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) + +}; + + +#ifdef OLED_ENABLE + + char wpm_str[10]; + +static void render_ein60_logo(void) { + static const char PROGMEM ein60_logo[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 11,251,139,139,139,139,139,139,139,139,139,139,139, 11, 15, 0,240,240, 16,240, 0,240,240, 16,240,224,192,128, 0, 0, 0, 0,240, 16,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254,255, 11,251,139,139,139,139,139,139,139,139,139,139,139,143,128, 0, 0, 0, 0,254,255, 11,251, 11, 11, 11, 11,139,203,235,123,187,219,235,251,255, 7,252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 4,253,197,197,197,197,197,197,197,197,197,197,199,192,192, 0,255,255, 0,255, 0,255,255, 0,254, 13, 27, 55,111,222,188,120,255, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0,255,197,197,197,197,197,197,197,197,197,197,253,253,255,131,254, 0, 0,255,255, 0,255,184,220,238,247,219,205,198,195,193,192,255,255,255,128,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 3, 3, 2, 3, 0, 3, 3, 2, 3, 0, 0, 0, 0, 0, 1, 3, 2, 2, 3, 0, 8, 28, 20, 20, 20, 20, 20, 28, 8, 0, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + oled_write_raw_P(ein60_logo, sizeof(ein60_logo)); + } + + + +static void render_status(void) { +//void oled_task_user(void) { + + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + switch (get_highest_layer(layer_state)) { + case _WINBASE: + oled_write_P(PSTR("Base\n"), false); + break; + case _SYMB: + oled_write_P(PSTR("Symbol\n"), false); + break; + case _FUNC: + oled_write_P(PSTR("FN\n"), false); + break; + case _MNMB: + oled_write_P(PSTR("Numbpad Mac\n"), false); + break; + case _NUMB: + oled_write_P(PSTR("Numbpad\n"), false); + break; + case _MDIA: + oled_write_P(PSTR("Media\n"), false); + break; + default: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_ln_P(PSTR("Undefined"), false); + } + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); + + + sprintf(wpm_str, "WPM: %03d", get_current_wpm()); + oled_set_cursor(1,2); + oled_write(wpm_str, false); + +} + +void oled_task_user(void) { + + render_status(); + oled_write_ln_P(PSTR(""), false); + render_ein60_logo(); + +} + +#endif + + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { /* Second encoder */ + if (clockwise) { + tap_code(KC_DOWN); + } else { + tap_code(KC_UP); + } + } + return true; +} + + diff --git a/keyboards/ein_60/keymaps/klackygears/readme.md b/keyboards/ein_60/keymaps/klackygears/readme.md new file mode 100644 index 0000000000..f97a08bd09 --- /dev/null +++ b/keyboards/ein_60/keymaps/klackygears/readme.md @@ -0,0 +1 @@ +This is the klackygears userspace keymap for EIN_60. My userspace is heavily based on Drashna's userspace and draws a lot of features from him. diff --git a/keyboards/ein_60/keymaps/klackygears/rules.mk b/keyboards/ein_60/keymaps/klackygears/rules.mk new file mode 100644 index 0000000000..885ab5bafe --- /dev/null +++ b/keyboards/ein_60/keymaps/klackygears/rules.mk @@ -0,0 +1,8 @@ + +# Build Options +# change yes to no to disable +ENCODER_ENABLE = yes # Enables the use of one or more encoders +WPM_ENABLE = yes # Enables the WPM counter on the OLED +RGB_MATRIX_ENABLE = yes # Enable for pretty RGB matrix effects +AUDIO_ENABLE = yes +TAP_DANCE_ENABLE = yes diff --git a/keyboards/ein_60/keymaps/ledtest/keymap.c b/keyboards/ein_60/keymaps/ledtest/keymap.c new file mode 100644 index 0000000000..6f903124af --- /dev/null +++ b/keyboards/ein_60/keymaps/ledtest/keymap.c @@ -0,0 +1,207 @@ +/* Copyright 2021 klackygears + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include QMK_KEYBOARD_H + +enum layer_names { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _FUNCTION, + }; + +enum custom_keycodes { + RGBRST = SAFE_RANGE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. ,------. ,----------------------------------------. + * | Tab | Q | W | E | R | T | | Esc | |RGBRST|RGBHUI|RGBSAI|RGBVAI|RGBSPI| Bksp | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | Func | A | S | D | F | G | |RGBRMO|RGBHUD|RGBSAD|RGBVAD|RGBSPD|Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | |RGBTOG| M | , | . | / | ' | + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | Ctrl | ` | GUI | Alt |Lower |Space | |Space | |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MUTE, RGBRST, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_BSPC, + MO(_FUNCTION), KC_A, KC_S, KC_D, KC_F, KC_G, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_ENT, + OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, RGB_TOG, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, + KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, KC_SPC, KC_CAPS, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + /* Lower + * ,-----------------------------------------. ,------. ,-----------------------------------------. + * | Esc | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | F1 | F2 | F3 | F4 | F5 | F6 | | | _ | + | { | } |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | F7 | F8 | F9 | F10 | F11 | F12 | | | | | Mute | | | | + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | | | | |Lower | Bksp | | | | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_LOWER] = LAYOUT( + KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_MUTE, _______, KC_PIPE, + _______, _______, _______, _______, _______, KC_BSPC, _______, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + /* Raise + * ,-----------------------------------------. ,------. ,-----------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | | 4 | 5 | 6 | + | F5 | | F6 | - | = | [ | ] |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Enter | 7 | 8 | 9 | - | F11 | | F12 |ISO # |ISO / | Mute | | \ | + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | | , | 0 | . |Lower | Bksp | | | | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_RAISE] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, KC_4, KC_5, KC_6, KC_PLUS, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, + KC_ENT, KC_7, KC_8, KC_9, KC_MINS, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_MUTE, _______, KC_BSLS, + _______, KC_COMM, KC_0, KC_DOT, _______, KC_BSPC, _______, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + /* Adjust (Lower + Raise) + * ,-----------------------------------------. ,------. ,-----------------------------------------. + * | | | | | | | | | |RGBRST|RGBMOD|RGBVAI|RGBSAI|RGBHUI| | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | | | | | | | | |RGBRMO|RGBVAD|RGBSAD|RGBHUD|RGBTOG| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | |BLSTEP| + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | | | | | | | | | | | | | | | RESET| + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_ADJUST] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, RGBRST, RGB_MOD, RGB_VAI, RGB_SAI, RGB_HUI, _______, + _______, _______, _______, _______, _______, _______, _______, RGB_RMOD,RGB_VAD, RGB_SAD, RGB_HUD, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_STEP, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET + ), + /* Function + * ,-----------------------------------------. ,------. ,-----------------------------------------. + * | | | | | | | | | | | | Up | | | | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | | | | | | | | | Left | Down |Right | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Caps | | | | | | | | | | | | | + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | | | | | | | | | | | | | | | | + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_FUNCTION] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +#ifdef OLED_ENABLE + + +static void render_ein60_logo(void) { + static const char PROGMEM ein60_logo[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 11,251,139,139,139,139,139,139,139,139,139,139,139, 11, 15, 0,240,240, 16,240, 0,240,240, 16,240,224,192,128, 0, 0, 0, 0,240, 16,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254,255, 11,251,139,139,139,139,139,139,139,139,139,139,139,143,128, 0, 0, 0, 0,254,255, 11,251, 11, 11, 11, 11,139,203,235,123,187,219,235,251,255, 7,252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 4,253,197,197,197,197,197,197,197,197,197,197,199,192,192, 0,255,255, 0,255, 0,255,255, 0,254, 13, 27, 55,111,222,188,120,255, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0,255,197,197,197,197,197,197,197,197,197,197,253,253,255,131,254, 0, 0,255,255, 0,255,184,220,238,247,219,205,198,195,193,192,255,255,255,128,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 3, 3, 2, 3, 0, 3, 3, 2, 3, 0, 0, 0, 0, 0, 1, 3, 2, 2, 3, 0, 8, 28, 20, 20, 20, 20, 20, 28, 8, 0, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + oled_write_raw_P(ein60_logo, sizeof(ein60_logo)); + } + +static void render_status(void) { + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + switch (get_highest_layer(layer_state)) { + case _QWERTY: + oled_write_P(PSTR("Default\n"), false); + break; + case _LOWER: + oled_write_P(PSTR("Lower\n"), false); + break; + case _RAISE: + oled_write_P(PSTR("Raise\n"), false); + break; + case _ADJUST: + oled_write_P(PSTR("Adjust\n"), false); + break; + case _FUNCTION: + oled_write_P(PSTR("FN\n"), false); + break; + default: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_ln_P(PSTR("Undefined"), false); + } + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); + + oled_set_cursor(1,2); +} + +void oled_task_user(void) { + + render_status(); + oled_write_ln_P(PSTR(""), false); + render_ein60_logo(); +} +#endif + + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { /* Second encoder */ + if (clockwise) { + tap_code(KC_DOWN); + } else { + tap_code(KC_UP); + } + } + return true; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + } + #endif + break; + } + return true; +} diff --git a/keyboards/ein_60/keymaps/ledtest/readme.md b/keyboards/ein_60/keymaps/ledtest/readme.md new file mode 100644 index 0000000000..17954c3322 --- /dev/null +++ b/keyboards/ein_60/keymaps/ledtest/readme.md @@ -0,0 +1 @@ +# The keymap for testing the LEDs and OLED on the EIN_60 diff --git a/keyboards/ein_60/keymaps/ledtest/rules.mk b/keyboards/ein_60/keymaps/ledtest/rules.mk new file mode 100644 index 0000000000..a628544562 --- /dev/null +++ b/keyboards/ein_60/keymaps/ledtest/rules.mk @@ -0,0 +1,4 @@ +# Build Options +# change yes to no to disable +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +RGB_MATRIX_ENABLE = no # Enable for pretty RGB matrix effects |