logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

process_repeat_key.h (2502B)


  1. // Copyright 2022-2023 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // https://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #pragma once
  15. #include <stdint.h>
  16. #include <stdbool.h>
  17. #include "action.h"
  18. /**
  19. * @brief Process handler for remembering the last key.
  20. *
  21. * @param keycode Keycode registered by matrix press, per keymap
  22. * @param record keyrecord_t structure
  23. * @return true Continue processing keycodes, and send to host
  24. * @return false Stop processing keycodes, and don't send to host
  25. */
  26. bool process_last_key(uint16_t keycode, keyrecord_t* record);
  27. /**
  28. * @brief Optional callback defining which keys are remembered.
  29. *
  30. * @param keycode Keycode that was just pressed
  31. * @param record keyrecord_t structure
  32. * @param remembered_mods Mods that will be remembered with this key
  33. * @return true Key is remembered
  34. * @return false Key is ignored
  35. *
  36. * Modifier and layer switch keys are always ignored. For all other keys, this
  37. * callback is called on every key press. Returning true means that the key is
  38. * remembered, false means it is ignored. By default, all non-modifier,
  39. * non-layer switch keys are remembered.
  40. *
  41. * The `remembered_mods` arg represents the mods that will be remembered with
  42. * this key. It can be modified to forget certain mods, for instance to forget
  43. * capitalization when repeating shifted letters:
  44. *
  45. * // Forget Shift on letter keys.
  46. * if (KC_A <= keycode && keycode <= KC_Z && (*remembered_mods & ~MOD_MASK_SHIFT) == 0) {
  47. * *remembered_mods = 0;
  48. * }
  49. */
  50. bool remember_last_key_user(uint16_t keycode, keyrecord_t* record, uint8_t* remembered_mods);
  51. /**
  52. * @brief Process handler for Repeat Key feature.
  53. *
  54. * @param keycode Keycode registered by matrix press, per keymap
  55. * @param record keyrecord_t structure
  56. * @return true Continue processing keycodes, and send to host
  57. * @return false Stop processing keycodes, and don't send to host
  58. */
  59. bool process_repeat_key(uint16_t keycode, keyrecord_t* record);