1
0
Fork 0

[Keymap] Drashna Keymap updates for 0.21.0 (#21073)

This commit is contained in:
Drashna Jael're 2023-05-31 11:44:06 -07:00 committed by GitHub
parent 1411c79aef
commit 3a3e5abac9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
71 changed files with 1609 additions and 2215 deletions

View file

@ -18,8 +18,6 @@
enum more_custom_keycodes {
KC_SWAP_NUM = USER_SAFE_RANGE,
PM_SCROLL,
PM_PRECISION,
};
// define layer change stuff for underglow indicator
@ -44,9 +42,9 @@ bool skip_leds = false;
LAYOUT_ergodox_pretty_wrapper( \
KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \
LALT_T(KC_TAB), K01, K02, K03, K04, K05, TG_DBLO, TG_DBLO, K06, K07, K08, K09, K0A, KC_BSLS, \
KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(K1B), \
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG_GAME, TG_GAME, K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \
KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_BTN1, KC_BTN3, KC_BTN2, PM_SCROLL, PM_PRECISION, \
KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(K1B), \
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG_GAME, TG_GAME, K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \
KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, KC_NO, \
OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \
KC_APP, KC_MENU, \
KC_SPC, LT(_LOWER, KC_BSPC), OS_LWR, OS_RSE, LT(_RAISE, KC_DEL), KC_ENT \
@ -180,36 +178,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
// clang-format on
#ifdef PIMORONI_TRACKBALL_ENABLE
void run_trackball_cleanup(void) {
// if (trackball_is_scrolling()) {
// trackball_set_rgbw(RGB_CYAN, 0x00);
// } else if (trackball_get_precision() != 1.0) {
// trackball_set_rgbw(RGB_GREEN, 0x00);
// } else {
// trackball_set_rgbw(RGB_MAGENTA, 0x00);
// }
}
void keyboard_post_init_keymap(void) {
// trackball_set_precision(1.5);
// trackball_set_rgbw(RGB_MAGENTA, 0x00);
}
// void shutdown_keymap(void) { trackball_set_rgbw(RGB_RED, 0x00); }
static bool mouse_button_one, trackball_button_one;
void trackball_register_button(bool pressed, enum mouse_buttons button) {
report_mouse_t currentReport = pointing_device_get_report();
if (pressed) {
currentReport.buttons |= button;
} else {
currentReport.buttons &= ~button;
}
pointing_device_set_report(currentReport);
}
#endif
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_1:
@ -235,40 +203,15 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
case KC_SWAP_NUM:
if (record->event.pressed) {
userspace_config.swapped_numbers ^= 1;
eeconfig_update_user(userspace_config.raw);
eeconfig_update_user_config(&userspace_config.raw);
}
break;
#ifdef PIMORONI_TRACKBALL_ENABLE
case PM_SCROLL:
// trackball_set_scrolling(record->event.pressed);
run_trackball_cleanup();
break;
case PM_PRECISION:
// if (record->event.pressed) {
// trackball_set_precision(1.5);
// } else {
// trackball_set_precision(1);
// }
// run_trackball_cleanup();
break;
# if !defined(MOUSEKEY_ENABLE)
case KC_MS_BTN1:
mouse_button_one = record->event.pressed;
trackball_register_button(mouse_button_one | trackball_button_one, MOUSE_BTN1);
break;
case KC_MS_BTN2:
trackball_register_button(record->event.pressed, MOUSE_BTN2);
break;
case KC_MS_BTN3:
trackball_register_button(record->event.pressed, MOUSE_BTN3);
break;
# endif
#endif
}
return true;
}
void housekeeping_task_keymap(void) { // runs frequently to update info
#ifdef KEYBOARD_ergodox_ez
uint8_t modifiers = get_mods();
uint8_t led_usb_state = host_keyboard_leds();
uint8_t one_shot = get_oneshot_mods();
@ -295,6 +238,7 @@ void housekeeping_task_keymap(void) { // runs frequently to update info
ergodox_right_led_3_set(10);
}
}
#endif
}
bool indicator_is_this_led_used_keyboard(uint8_t index) {

View file

@ -8,10 +8,13 @@ ifeq ($(strip $(KEYBOARD)), ergodox_ez)
RGB_MATRIX_ENABLE = yes
INDICATOR_LIGHTS = no
RGBLIGHT_STARTUP_ANIMATION = yes
PIMORONI_TRACKBALL_ENABLE = no
MOUSEKEY_ENABLE = no
endif
UNICODE_ENABLE = no
UNICDOEMAP_ENABLE = no
CUSTOM_UNICODE_ENABLE = no
ifeq ($(strip $(KEYBOARD)), hotdox76v2)
OLED_ENABLE = no
RGB_MATRIX_ENABLE = no
endif

View file

@ -237,34 +237,6 @@ void keyboard_post_init_keymap(void) {
}
#endif // RGB_MATRIX_INIT
#ifdef ENCODER_ENABLE
bool encoder_update_user(uint8_t index, bool clockwise) {
switch (get_highest_layer(layer_state)) {
case _RAISE:
clockwise ? tap_code(KC_VOLD) : tap_code(KC_VOLU);
break;
case _LOWER:
# ifdef RGB_MATRIX_ENABLE
clockwise ? rgb_matrix_step() : rgb_matrix_step_reverse();
# else
clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP);
# endif
break;
case _ADJUST:
# ifdef AUDIO_CLICKY
clockwise ? clicky_freq_up() : clicky_freq_down();
# endif
break;
default:
clockwise ? tap_code(KC_DOWN) : tap_code(KC_UP);
}
# ifdef AUDIO_CLICKY
clicky_play();
# endif
return true;
}
#endif // ENCODER_ENABLE
#ifdef KEYBOARD_planck_rev6
bool dip_switch_update_user(uint8_t index, bool active) {
switch (index) {