Add draculad keyboard and some 3x5 tweaks
This commit is contained in:
parent
2c433a2114
commit
4607d8ea55
5 changed files with 207 additions and 12 deletions
33
keyboards/draculad/keymaps/struckmb/config.h
Normal file
33
keyboards/draculad/keymaps/struckmb/config.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
Copyright 2021 @mangoiv
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
// comment that out if your trackball is on the left side
|
||||
#define TRACKBALL_RIGHT
|
||||
|
||||
#ifdef TRACKBALL_RIGHT
|
||||
# define PIMORONI_TRACKBALL_INVERT_X
|
||||
# define PIMORONI_TRACKBALL_INVERT_Y
|
||||
#endif // TRACKBALL_RIGHT
|
||||
#define POINTING_DEVICE_ROTATION_90
|
||||
|
||||
#define QWERTY_ENABLE
|
||||
// #define BONE_ENABLE
|
||||
|
||||
#ifdef COMBO_ENABLE
|
||||
# define EXTRA_SHORT_COMBOS
|
||||
// # define COMBO_SHOULD_TRIGGER
|
||||
#endif // COMBO_ENABLE
|
||||
144
keyboards/draculad/keymaps/struckmb/keymap.c
Normal file
144
keyboards/draculad/keymaps/struckmb/keymap.c
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
/*
|
||||
Copyright 2021 @mangoiv
|
||||
|
||||
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 "struckmb.h"
|
||||
|
||||
#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
#ifdef QWERTY_ENABLE
|
||||
[LAYER_QWERTY] = LAYOUT_wrapper(_QWERTY_3x5_, KC_MUTE, KC_MUTE, _0L4_3_, KC_BTN1, SFT_SPC, LT(LAYER_RAISE, RSE_BSP)),
|
||||
[LAYER_X] = LAYOUT_wrapper(_QWERTY_L_X_, KC_MUTE, KC_MUTE, _0L4_3_, KC_BTN1, SFT_SPC, LT(LAYER_RAISE, RSE_BSP)),
|
||||
#endif // ifdef QWERTY_ENABLE
|
||||
#ifdef BONE_ENABLE
|
||||
[LAYER_BONE] = LAYOUT_wrapper(_BONE_3x5_, KC_MUTE, KC_MUTE, _0L4_3_, KC_BTN1, SFT_SPC, LT(LAYER_RAISE, RSE_BSP)),
|
||||
#endif // ifdef BONE_ENABLE
|
||||
#ifdef COLEMAK_DH_ENABLE
|
||||
[LAYER_COLEMAK_DH] = LAYOUT_wrapper(_COLEMAK_DH_3x5_, KC_MUTE, KC_MUTE, _0L4_3_, KC_BTN1, SFT_SPC, LT(LAYER_RAISE, RSE_BSP)),
|
||||
#endif /* ifdef COLEMAK_DH_ENABLE */
|
||||
|
||||
[LAYER_SYMBL] = LAYOUT_wrapper(_SYMBL_3x5_, KC_MUTE, KC_MUTE, _SL4_3_, KC_BTN1, SFT_SPC, KC_RALT),
|
||||
[LAYER_LOWER] = LAYOUT_wrapper(_LOWER_3x5_, KC_MUTE, KC_MUTE, _LL4_3_, KC_BTN1, SFT_SPC, ATT(KC_BSPC)),
|
||||
[LAYER_RAISE] = LAYOUT_wrapper(_RAISE_3x5_, KC_MUTE, KC_MUTE, _RL4_3_, KC_BTN1, RSFT_T(KC_VOLU), KC_TRNS),
|
||||
[LAYER_ATTIC] = LAYOUT_wrapper(_ATTIC_3x5_, KC_MUTE, KC_MUTE, _AL4_3_, KC_BTN1, RSFT_T(KC_BRIU), KC_TRNS),
|
||||
};
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
if (is_keyboard_master()) {
|
||||
if (is_keyboard_left()) {
|
||||
return OLED_ROTATION_270;
|
||||
} else {
|
||||
return OLED_ROTATION_90;
|
||||
}
|
||||
} else {
|
||||
return OLED_ROTATION_0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef X__OLED_ENABLE
|
||||
static void render_logo(void) {
|
||||
static const char PROGMEM drac_logo[] = {// drac_logo, 128x64px
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x0c, 0x18, 0x78, 0xf0, 0xf0, 0xe0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x07, 0x3e, 0xfc, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0x60, 0x30, 0x30, 0x30, 0x00, 0x00, 0xe0, 0xe0, 0x30, 0x30, 0x30, 0x30, 0x30, 0xe0, 0xe0, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x70, 0x30, 0x30, 0x30, 0x70, 0xe0, 0xc0, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x80, 0xe0, 0xf8, 0xf0, 0x80, 0xc0, 0xe0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0xf8, 0xe0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xe0, 0x7c, 0x3f, 0x0f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xf8, 0xcc, 0x8c, 0x84, 0x86, 0x86, 0xc6, 0xff, 0xff, 0x80, 0x80, 0x00, 0x3f, 0x7f, 0xe0, 0xc0, 0x80, 0x80, 0x80, 0xc0, 0xf0, 0x71, 0x00, 0x00, 0x1f, 0xff, 0xff, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x03, 0x03, 0x07, 0x0f, 0x0f, 0x0f, 0x1f, 0x7f, 0x7f, 0x3e, 0x3e, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xf8, 0xf8, 0xfc, 0xfc, 0xfe, 0xfe, 0x7e, 0x7c, 0x78, 0xe0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xc0, 0xc0, 0x60, 0x60, 0x60, 0x60, 0x60, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xe0, 0x60, 0x60, 0x60, 0xc0, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x0f, 0x3e, 0x7c, 0xfc, 0xf8, 0xf8, 0xf8, 0xf8, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf8, 0xf8, 0xf8, 0xfc, 0xfc, 0xfc, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x3f, 0x1f, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf1, 0x99, 0x18, 0x08, 0x0c, 0x0c, 0x8c, 0xff, 0xff, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xc1, 0x80, 0x00, 0x00, 0x00,
|
||||
0x80, 0xc3, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x07, 0x0f, 0x0f, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x0f, 0x0f, 0x07, 0x07, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x03, 0x03, 0x03, 0x00, 0x00, 0x01, 0x01, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
oled_write_raw_P(drac_logo, sizeof(drac_logo));
|
||||
}
|
||||
|
||||
static void render_status(void) {
|
||||
oled_write_P(PSTR("This is\n~~~~~~~~~\nDracu\nLad\n~~~~~~~~~\nv1.0\n~~~~~~~~~\n"), false);
|
||||
uint8_t n = get_current_wpm();
|
||||
char wpm_counter[4];
|
||||
wpm_counter[3] = '\0';
|
||||
wpm_counter[2] = '0' + n % 10;
|
||||
wpm_counter[1] = (n /= 10) % 10 ? '0' + (n) % 10 : (n / 10) % 10 ? '0' : ' ';
|
||||
wpm_counter[0] = n / 10 ? '0' + n / 10 : ' ';
|
||||
oled_write_P(PSTR("WPM:"), false);
|
||||
oled_write(wpm_counter, false);
|
||||
led_t led_state = host_keyboard_led_state();
|
||||
oled_write_P(PSTR("\nCaps: "), false);
|
||||
oled_write_P(led_state.caps_lock ? PSTR("on ") : PSTR("off"), false);
|
||||
oled_write_P(PSTR("\n"), false);
|
||||
// switch (get_highest_layer(layer_state)) {
|
||||
// case _BASE:
|
||||
// oled_write_P(PSTR("Base "), false);
|
||||
// break;
|
||||
// case _NUM:
|
||||
// oled_write_P(PSTR("Numbers"), false);
|
||||
// break;
|
||||
// case _SYMB:
|
||||
// oled_write_P(PSTR("Symbols"), false);
|
||||
// break;
|
||||
// case _ADJ:
|
||||
// oled_write_P(PSTR("Adjust "), false);
|
||||
// break;
|
||||
// case _MUS:
|
||||
// oled_write_P(PSTR("Mouse "), false);
|
||||
// break;
|
||||
// default:
|
||||
// oled_write_P(PSTR("Unkn "), false);
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
|
||||
} else {
|
||||
render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENCODER_ENABLE
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (index == 0) {
|
||||
// Volume control
|
||||
tap_code(clockwise ? KC_VOLU : KC_VOLD);
|
||||
}
|
||||
// Page up/Page down
|
||||
tap_code(clockwise ? KC_PGUP : KC_PGDN);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef X__COMBO_ENABLE
|
||||
# ifdef QWERTY_ENABLE
|
||||
const uint16_t PROGMEM combo_qwerty_ue[] = {DE_Q, DE_P, COMBO_END};
|
||||
const uint16_t PROGMEM combo_qwerty_ae[] = {DE_Q, DE_OE, COMBO_END};
|
||||
|
||||
combo_t key_combos[] = {
|
||||
COMBO(combo_qwerty_ue, DE_UDIA),
|
||||
COMBO(combo_qwerty_ae, DE_ADIA),
|
||||
};
|
||||
# endif // QWERTY_ENABLE
|
||||
|
||||
# ifdef COMBO_SHOULD_TRIGGER
|
||||
bool combo_should_trigger(uint16_t combo_index, combo_t *combo, uint16_t keycode, keyrecord_t *record) {
|
||||
# ifdef QWERTY_ENABLE
|
||||
/* Trigger qwerty umlaut combos only on qwerty layer */
|
||||
return layer_state_is(LAYER_QWERTY);
|
||||
# endif // QWERTY_ENABLE
|
||||
};
|
||||
# endif // COMBO_SHOULD_TRIGGER
|
||||
#endif // COMBO_ENABLE
|
||||
7
keyboards/draculad/keymaps/struckmb/rules.mk
Normal file
7
keyboards/draculad/keymaps/struckmb/rules.mk
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# only uncomment on the side you have your trackball on
|
||||
POINTING_DEVICE_ENABLE = yes
|
||||
POINTING_DEVICE_DRIVER = pimoroni_trackball
|
||||
|
||||
QUANTUM_LIB_SRC += i2c_master.c
|
||||
OLED_DRIVER_ENABLE = yes
|
||||
MOUSEKEY_ENABLE = no
|
||||
Loading…
Add table
Add a link
Reference in a new issue