diff options
| author | Drashna Jaelre <drashna@live.com> | 2020-06-15 03:41:28 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-15 03:41:28 -0700 |
| commit | 357a888d805c21c9cb4917f55d558195e8b85db5 (patch) | |
| tree | fd1e8c30c3754ff89e8efd7e94ced3a1a8d92035 /layouts | |
| parent | 7f5656996ca2f5a62a148ef9165d0681ba806f07 (diff) | |
| download | qmk_firmware-357a888d805c21c9cb4917f55d558195e8b85db5.tar.gz qmk_firmware-357a888d805c21c9cb4917f55d558195e8b85db5.zip | |
[Keymap] Drashna's Keymap Update - Display Edition (#9282)
OLED Display fixes
Add support for RGBLIGHT Layers
Add gaming layer to corn and kyria
RGBLight Startup Animation fixes and improvements (uses matrix_scan now!)
Pimoroni Trackball support added (IT'S RGB!!!)
Fix issues due to code changes
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/community/ergodox/drashna/config.h | 5 | ||||
| -rw-r--r-- | layouts/community/ergodox/drashna/keymap.c | 58 | ||||
| -rw-r--r-- | layouts/community/ergodox/drashna/rules.mk | 14 | ||||
| -rw-r--r-- | layouts/community/ortho_5x12/drashna/rules.mk | 11 |
4 files changed, 73 insertions, 15 deletions
diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h index 8f1c9f6a2..8ad589f93 100644 --- a/layouts/community/ergodox/drashna/config.h +++ b/layouts/community/ergodox/drashna/config.h | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Hybrid Monstrosity | 15 | #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Hybrid Monstrosity |
| 16 | 16 | ||
| 17 | #undef DEBOUNCE | 17 | #undef DEBOUNCE |
| 18 | #define DEBOUNCE 60 | 18 | #define DEBOUNCE 15 |
| 19 | 19 | ||
| 20 | #define TAPPING_TERM_PER_KEY | 20 | #define TAPPING_TERM_PER_KEY |
| 21 | 21 | ||
| @@ -30,3 +30,6 @@ | |||
| 30 | # undef RGBLIGHT_SLEEP | 30 | # undef RGBLIGHT_SLEEP |
| 31 | # endif | 31 | # endif |
| 32 | #endif | 32 | #endif |
| 33 | |||
| 34 | #define PIMORONI_TRACKBALL_INVERT_X | ||
| 35 | #define PIMORONI_TRACKBALL_INVERT_Y | ||
diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index cb256e5e5..8f5aaf6cd 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c | |||
| @@ -10,7 +10,11 @@ | |||
| 10 | extern rgblight_config_t rgblight_config; | 10 | extern rgblight_config_t rgblight_config; |
| 11 | #endif | 11 | #endif |
| 12 | 12 | ||
| 13 | enum more_custom_keycodes { KC_SWAP_NUM = NEW_SAFE_RANGE }; | 13 | enum more_custom_keycodes { |
| 14 | KC_SWAP_NUM = NEW_SAFE_RANGE, | ||
| 15 | PM_SCROLL, | ||
| 16 | PM_PRECISION, | ||
| 17 | }; | ||
| 14 | 18 | ||
| 15 | // define layer change stuff for underglow indicator | 19 | // define layer change stuff for underglow indicator |
| 16 | bool skip_leds = false; | 20 | bool skip_leds = false; |
| @@ -33,7 +37,7 @@ bool skip_leds = false; | |||
| 33 | LALT_T(KC_TAB), K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ | 37 | LALT_T(KC_TAB), K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ |
| 34 | KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ | 38 | KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ |
| 35 | KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \ | 39 | KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \ |
| 36 | KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ | 40 | KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_BTN1, KC_BTN3, KC_BTN2, PM_SCROLL, PM_PRECISION, \ |
| 37 | OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ | 41 | OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ |
| 38 | KC_APP, KC_MENU, \ | 42 | KC_APP, KC_MENU, \ |
| 39 | KC_SPC, LT(_LOWER, KC_BSPC), OS_LWR, OS_RSE, LT(_RAISE, KC_DEL), KC_ENT \ | 43 | KC_SPC, LT(_LOWER, KC_BSPC), OS_LWR, OS_RSE, LT(_RAISE, KC_DEL), KC_ENT \ |
| @@ -281,7 +285,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 281 | 285 | ||
| 282 | [_ADJUST] = LAYOUT_ergodox_pretty_wrapper( | 286 | [_ADJUST] = LAYOUT_ergodox_pretty_wrapper( |
| 283 | KC_MAKE, _______, _______, _______, _______, _______, UC_MOD, KC_NUKE, _________________ADJUST_R1_________________, KC_RST, | 287 | KC_MAKE, _______, _______, _______, _______, _______, UC_MOD, KC_NUKE, _________________ADJUST_R1_________________, KC_RST, |
| 284 | VRSN, _________________ADJUST_L1_________________, _______, _______, _______, _______, _______, _______, _______, EEP_RST, | 288 | VRSN, _________________ADJUST_L1_________________, _______, _______, _________________ADJUST_R1_________________, EEP_RST, |
| 285 | _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, RGB_IDL, | 289 | _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, RGB_IDL, |
| 286 | _______, _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, TG(_MODS), | 290 | _______, _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, TG(_MODS), |
| 287 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 291 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| @@ -293,6 +297,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 293 | }; | 297 | }; |
| 294 | // clang-format on | 298 | // clang-format on |
| 295 | 299 | ||
| 300 | #ifdef PIMORONI_TRACKBALL_ENABLE | ||
| 301 | void run_trackball_cleanup(void) { | ||
| 302 | if (trackball_is_scrolling()) { | ||
| 303 | trackball_set_rgbw(RGB_CYAN, 0x00); | ||
| 304 | } else if (trackball_get_precision() != 1.0) { | ||
| 305 | trackball_set_rgbw(RGB_GREEN, 0x00); | ||
| 306 | } else { | ||
| 307 | trackball_set_rgbw(RGB_MAGENTA, 0x00); | ||
| 308 | } | ||
| 309 | } | ||
| 310 | |||
| 311 | void keyboard_post_init_keymap(void) { | ||
| 312 | // trackball_set_precision(1.5); | ||
| 313 | trackball_set_rgbw(RGB_MAGENTA, 0x00); | ||
| 314 | } | ||
| 315 | void shutdown_keymap(void) { | ||
| 316 | trackball_set_rgbw(RGB_RED, 0x00); | ||
| 317 | } | ||
| 318 | #endif | ||
| 319 | |||
| 296 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | 320 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { |
| 297 | switch (keycode) { | 321 | switch (keycode) { |
| 298 | case KC_1: | 322 | case KC_1: |
| @@ -321,6 +345,34 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | |||
| 321 | eeconfig_update_user(userspace_config.raw); | 345 | eeconfig_update_user(userspace_config.raw); |
| 322 | } | 346 | } |
| 323 | break; | 347 | break; |
| 348 | #ifdef PIMORONI_TRACKBALL_ENABLE | ||
| 349 | case PM_SCROLL: | ||
| 350 | trackball_set_scrolling(record->event.pressed); | ||
| 351 | run_trackball_cleanup(); | ||
| 352 | break; | ||
| 353 | case PM_PRECISION: | ||
| 354 | if (record->event.pressed) { | ||
| 355 | trackball_set_precision(1.5); | ||
| 356 | } else { | ||
| 357 | trackball_set_precision(1); | ||
| 358 | } | ||
| 359 | run_trackball_cleanup(); | ||
| 360 | break; | ||
| 361 | #if !defined(MOUSEKEY_ENABLE) && defined(POINTING_DEVICE_ENABLE) | ||
| 362 | case KC_BTN1 ... KC_BTN3: | ||
| 363 | { | ||
| 364 | report_mouse_t currentReport = pointing_device_get_report(); | ||
| 365 | if (record->event.pressed) { | ||
| 366 | currentReport.buttons |= (1 << (keycode - KC_BTN1)); // this is defined in report.h | ||
| 367 | } else { | ||
| 368 | currentReport.buttons &= ~(1 << (keycode - KC_BTN1)); | ||
| 369 | } | ||
| 370 | pointing_device_set_report(currentReport); | ||
| 371 | pointing_device_send(); | ||
| 372 | break; | ||
| 373 | } | ||
| 374 | # endif | ||
| 375 | #endif | ||
| 324 | } | 376 | } |
| 325 | // switch (keycode) { | 377 | // switch (keycode) { |
| 326 | // case KC_P00: | 378 | // case KC_P00: |
diff --git a/layouts/community/ergodox/drashna/rules.mk b/layouts/community/ergodox/drashna/rules.mk index 387bd20f6..51b4c9a60 100644 --- a/layouts/community/ergodox/drashna/rules.mk +++ b/layouts/community/ergodox/drashna/rules.mk | |||
| @@ -1,18 +1,20 @@ | |||
| 1 | BOOTMAGIC_ENABLE = lite | 1 | BOOTMAGIC_ENABLE = lite |
| 2 | TAP_DANCE_ENABLE = yes | 2 | TAP_DANCE_ENABLE = yes |
| 3 | COMMAND_ENABLE = no # Commands for debug and configuration | 3 | COMMAND_ENABLE = no # Commands for debug and configuration |
| 4 | CONSOLE_ENABLE = | 4 | CONSOLE_ENABLE = no |
| 5 | SPACE_CADET_ENABLE = no | 5 | SPACE_CADET_ENABLE = no |
| 6 | 6 | ||
| 7 | ifeq ($(strip $(KEYBOARD)), ergodox_ez) | 7 | ifeq ($(strip $(KEYBOARD)), ergodox_ez) |
| 8 | RGBLIGHT_ENABLE = yes | 8 | RGBLIGHT_ENABLE = yes |
| 9 | RGB_MATRIX_ENABLE = yes | 9 | RGB_MATRIX_ENABLE = yes |
| 10 | RGBLIGHT_TWINKLE = no | 10 | RGBLIGHT_TWINKLE = no |
| 11 | INDICATOR_LIGHTS = no | 11 | INDICATOR_LIGHTS = no |
| 12 | RGBLIGHT_STARTUP_ANIMATION = yes | 12 | RGBLIGHT_STARTUP_ANIMATION = yes |
| 13 | PIMORONI_TRACKBALL_ENABLE = yes | ||
| 14 | MOUSEKEY_ENABLE = no | ||
| 13 | endif | 15 | endif |
| 14 | 16 | ||
| 15 | UNICODE_ENABLE = yes | 17 | UNICODE_ENABLE = no |
| 16 | UNICDOEMAP_ENABLE = no | 18 | UNICDOEMAP_ENABLE = no |
| 17 | 19 | ||
| 18 | 20 | ||
diff --git a/layouts/community/ortho_5x12/drashna/rules.mk b/layouts/community/ortho_5x12/drashna/rules.mk index b5d55a681..2c59c614f 100644 --- a/layouts/community/ortho_5x12/drashna/rules.mk +++ b/layouts/community/ortho_5x12/drashna/rules.mk | |||
| @@ -7,9 +7,10 @@ TAP_DANCE_ENABLE = no | |||
| 7 | NKRO_ENABLE = yes | 7 | NKRO_ENABLE = yes |
| 8 | 8 | ||
| 9 | ifeq ($(strip $(KEYBOARD)), fractal) | 9 | ifeq ($(strip $(KEYBOARD)), fractal) |
| 10 | RGB_MATRIX_ENABLE = no | 10 | RGB_MATRIX_ENABLE = no |
| 11 | AUDIO_ENABLE = yes | 11 | AUDIO_ENABLE = yes |
| 12 | RGBLIGHT_ENABLE = yes | 12 | RGBLIGHT_ENABLE = yes |
| 13 | RGBLIGHT_TWINKLE = yes | 13 | RGBLIGHT_TWINKLE = yes |
| 14 | BOOTLOADER = qmk-dfu | 14 | RGBLIGHT_STARTUP_ANIMATION = yes |
| 15 | BOOTLOADER = qmk-dfu | ||
| 15 | endif | 16 | endif |
