tapping.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. default:
  10. return TAPPING_TERM;
  11. }
  12. }
  13. #endif // TAPPING_TERM_PER_KEY
  14. #ifdef PERMISSIVE_HOLD_PER_KEY
  15. __attribute__((weak)) bool get_permissive_hold(uint16_t keycode, keyrecord_t *record) {
  16. // Immediately select the hold action when another key is tapped:
  17. // return true;
  18. // Do not select the hold action when another key is tapped.
  19. // return false;
  20. switch (keycode) {
  21. default:
  22. return false;
  23. }
  24. }
  25. #endif // PERMISSIVE_HOLD_PER_KEY
  26. #ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY
  27. __attribute__((weak)) bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) {
  28. // Immediately select the hold action when another key is pressed.
  29. // return true;
  30. // Do not select the hold action when another key is pressed.
  31. // return false;
  32. switch (keycode) {
  33. // case QK_LAYER_TAP ... QK_LAYER_TAP_MAX:
  34. // return true;
  35. default:
  36. return false;
  37. }
  38. }
  39. #endif // HOLD_ON_OTHER_KEY_PRESS_PER_KEY
  40. #ifdef QUICK_TAP_TERM_PER_KEY
  41. __attribute__((weak)) uint16_t get_quick_tap_term(uint16_t keycode, keyrecord_t *record) {
  42. switch (keycode) {
  43. default:
  44. return QUICK_TAP_TERM;
  45. }
  46. }
  47. #endif // QUICK_TAP_TERM_PER_KEY
  48. #ifdef RETRO_TAPPING_PER_KEY
  49. __attribute__((weak)) bool get_retro_tapping(uint16_t keycode, keyrecord_t *record) {
  50. switch (keycode) {
  51. default:
  52. return false;
  53. }
  54. }
  55. #endif // RETRO_TAPPING_PER_KEY