diff options
author | Drashna Jaelre <drashna@live.com> | 2021-12-29 20:17:34 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-29 20:17:34 -0800 |
commit | c4551d7ef1ed2c1069f23cc8499b7c7fc30f3ecf (patch) | |
tree | 67dc381a45d59626132c4c59b71c4b36fa971f8b /keyboards/handwired/tractyl_manuform | |
parent | 1a8a842cfb3e87a82afb57ba29ca59c5fa6fe97b (diff) | |
download | qmk_firmware-c4551d7ef1ed2c1069f23cc8499b7c7fc30f3ecf.tar.gz qmk_firmware-c4551d7ef1ed2c1069f23cc8499b7c7fc30f3ecf.zip |
[Keymap] Reorganization, cleanup and readmes for drashna code (#15617)
Diffstat (limited to 'keyboards/handwired/tractyl_manuform')
-rw-r--r-- | keyboards/handwired/tractyl_manuform/4x6_right/keymaps/drashna/keymap.c | 100 | ||||
-rw-r--r-- | keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/rules.mk | 46 |
2 files changed, 33 insertions, 113 deletions
diff --git a/keyboards/handwired/tractyl_manuform/4x6_right/keymaps/drashna/keymap.c b/keyboards/handwired/tractyl_manuform/4x6_right/keymaps/drashna/keymap.c index 78a7db67a9..290ea22c5f 100644 --- a/keyboards/handwired/tractyl_manuform/4x6_right/keymaps/drashna/keymap.c +++ b/keyboards/handwired/tractyl_manuform/4x6_right/keymaps/drashna/keymap.c @@ -115,103 +115,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; // clang-format on - -#ifdef POINTING_DEVICE_ENABLE -static uint16_t mouse_timer = 0; -static uint16_t mouse_debounce_timer = 0; -static uint8_t mouse_keycode_tracker = 0; -bool tap_toggling = false; - -void process_mouse_user(report_mouse_t* mouse_report, int8_t x, int8_t y) { - if ((x || y) && timer_elapsed(mouse_timer) > 125) { - mouse_timer = timer_read(); - if (!layer_state_is(_MOUSE) && !(layer_state_is(_GAMEPAD) || layer_state_is(_DIABLO)) && timer_elapsed(mouse_debounce_timer) > 125) { - layer_on(_MOUSE); - } - } - -# ifdef TAPPING_TERM_PER_KEY - if (timer_elapsed(mouse_debounce_timer) > get_tapping_term(KC_BTN1, NULL) -# else - if (timer_elapsed(mouse_debounce_timer) > TAPPING_TERM -# endif - || (layer_state_is(_GAMEPAD) || layer_state_is(_DIABLO))) { - mouse_report->x = x; - mouse_report->y = y; - } -# ifdef OLED_ENABLE - if (x || y) oled_timer = timer_read32(); -# endif -} - -void matrix_scan_keymap(void) { - if (timer_elapsed(mouse_timer) > 650 && layer_state_is(_MOUSE) && !mouse_keycode_tracker && !tap_toggling) { - layer_off(_MOUSE); - } - if (tap_toggling) { - if (!layer_state_is(_MOUSE)) { - layer_on(_MOUSE); - } - } -} - -bool process_record_keymap(uint16_t keycode, keyrecord_t* record) { - switch (keycode) { - case TT(_MOUSE): - { - if (record->event.pressed) { - mouse_keycode_tracker++; - } else { -# if TAPPING_TOGGLE != 0 - if (record->tap.count == TAPPING_TOGGLE) { - tap_toggling ^= 1; -# if TAPPING_TOGGLE == 1 - if (!tap_toggling) mouse_keycode_tracker -= record->tap.count + 1; -# else - if (!tap_toggling) mouse_keycode_tracker -= record->tap.count; -# endif - } else { - mouse_keycode_tracker--; - } -# endif - } - mouse_timer = timer_read(); - break; - } - case MO(_MOUSE): - case DPI_CONFIG: - case KC_MS_UP ... KC_MS_WH_RIGHT: - record->event.pressed ? mouse_keycode_tracker++ : mouse_keycode_tracker--; - mouse_timer = timer_read(); - break; - default: - if (layer_state_is(_MOUSE) && !mouse_keycode_tracker) { - layer_off(_MOUSE); - } - mouse_keycode_tracker = 0; - mouse_debounce_timer = timer_read(); - break; - } - return true; -} - -layer_state_t layer_state_set_keymap(layer_state_t state) { - if (layer_state_cmp(state, _GAMEPAD) || layer_state_cmp(state, _DIABLO)) { - state |= (1UL << _MOUSE); - } - return state; -} -#endif - -void matrix_init_keymap(void) { -#ifdef AUDIO_ENABLE - extern audio_config_t audio_config; - - if (!is_keyboard_master()) { - audio_stop_all(); - audio_config.enable = false; - } -#endif -} - -void keyboard_post_init_keymap(void) { matrix_init_keymap(); } diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/rules.mk b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/rules.mk index 9b9032837e..0765bb2c6e 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/rules.mk +++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/rules.mk @@ -1,14 +1,34 @@ -RGBLIGHT_ENABLE = yes -RGBLIGHT_STARTUP_ANIMATION = yes -AUDIO_ENABLE = yes -HAPTIC_ENABLE = no -COMMAND_ENABLE = no -TAP_DANCE_ENABLE = yes -UNICODE_ENABLE = yes -OLED_ENABLE = yes -WPM_ENABLE = yes -ENCODER_ENABLE = yes -ENCODER_MAP_ENABLE = yes -# DEBOUNCE_TYPE = sym_eager_pk +COMMAND_ENABLE = no +RGBLIGHT_ENABLE = yes +RGBLIGHT_STARTUP_ANIMATION = yes +AUDIO_ENABLE = yes +HAPTIC_ENABLE = no +TAP_DANCE_ENABLE = yes +OLED_ENABLE = yes +WPM_ENABLE = yes +ENCODER_ENABLE = yes +ENCODER_MAP_ENABLE = yes +AUTOCORRECTION_ENABLE = yes +CAPS_WORD_ENABLE = yes -LTO_SUPPORTED = no +ifeq ($(strip $(KEYBOARD)), handwired/tractyl_manuform/5x6_right/elite_c) + RGBLIGHT_ENABLE = no + AUDIO_ENABLE = no + HAPTIC_ENABLE = no + TAP_DANCE_ENABLE = no + OLED_ENABLE = no + WPM_ENABLE = no + ENCODER_ENABLE = no + AUTOCORRECTION_ENABLE = no + LTO_SUPPORTED = yes + SWAP_HANDS_ENABLE = no + CUSTOM_UNICODE_ENABLE = no + CAPS_WORD_ENABLE = no + BOOTLOADER = qmk-hid + BOOTLOADER_SIZE = 512 +endif +ifeq ($(strip $(KEYBOARD)), handwired/tractyl_manuform/5x6_right/teensy2pp) + AUTOCORRECTION_ENABLE = no + CAPS_WORD_ENABLE = yes +endif +# DEBOUNCE_TYPE = sym_eager_pk |