tapping.c 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 IGNORE_MOD_TAP_INTERRUPT_PER_KEY
  41. __attribute__((weak)) bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) {
  42. // Do not force the mod-tap key press to be handled as a modifier
  43. // if any other key was pressed while the mod-tap key is held down.
  44. // return true;
  45. // Force the mod-tap key press to be handled as a modifier if any
  46. // other key was pressed while the mod-tap key is held down.
  47. // return false;
  48. switch (keycode) {
  49. default:
  50. return true;
  51. }
  52. }
  53. #endif // IGNORE_MOD_TAP_INTERRUPT_PER_KEY
  54. #ifdef TAPPING_FORCE_HOLD_PER_KEY
  55. __attribute__((weak)) bool get_tapping_force_hold(uint16_t keycode, keyrecord_t *record) {
  56. switch (keycode) {
  57. default:
  58. return false;
  59. }
  60. }
  61. #endif // TAPPING_FORCE_HOLD_PER_KEY
  62. #ifdef RETRO_TAPPING_PER_KEY
  63. __attribute__((weak)) bool get_retro_tapping(uint16_t keycode, keyrecord_t *record) {
  64. switch (keycode) {
  65. default:
  66. return false;
  67. }
  68. }
  69. #endif // RETRO_TAPPING_PER_KEY