You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.9 KiB

  1. // Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include "drashna.h"
  4. #ifdef TAPPING_TERM_PER_KEY
  5. __attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
  6. switch (keycode) {
  7. case BK_LWER:
  8. return TAPPING_TERM + 25;
  9. case QK_MOD_TAP ... QK_MOD_TAP_MAX:
  10. if (QK_MOD_TAP_GET_MODS(keycode) & MOD_LGUI) {
  11. return 300;
  12. }
  13. default:
  14. return TAPPING_TERM;
  15. }
  16. }
  17. #endif // TAPPING_TERM_PER_KEY
  18. #ifdef PERMISSIVE_HOLD_PER_KEY
  19. __attribute__((weak)) bool get_permissive_hold(uint16_t keycode, keyrecord_t *record) {
  20. // Immediately select the hold action when another key is tapped:
  21. // return true;
  22. // Do not select the hold action when another key is tapped.
  23. // return false;
  24. switch (keycode) {
  25. default:
  26. return false;
  27. }
  28. }
  29. #endif // PERMISSIVE_HOLD_PER_KEY
  30. #ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY
  31. __attribute__((weak)) bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) {
  32. // Immediately select the hold action when another key is pressed.
  33. // return true;
  34. // Do not select the hold action when another key is pressed.
  35. // return false;
  36. switch (keycode) {
  37. // case QK_LAYER_TAP ... QK_LAYER_TAP_MAX:
  38. // return true;
  39. default:
  40. return false;
  41. }
  42. }
  43. #endif // HOLD_ON_OTHER_KEY_PRESS_PER_KEY
  44. #ifdef QUICK_TAP_TERM_PER_KEY
  45. __attribute__((weak)) uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) {
  46. switch (keycode) {
  47. default:
  48. return QUICK_TAP_TERM;
  49. }
  50. }
  51. #endif // QUICK_TAP_TERM_PER_KEY
  52. #ifdef RETRO_TAPPING_PER_KEY
  53. __attribute__((weak)) bool get_retro_tapping(uint16_t keycode, keyrecord_t *record) {
  54. switch (keycode) {
  55. default:
  56. return false;
  57. }
  58. }
  59. #endif // RETRO_TAPPING_PER_KEY