keycodes.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
  3. * Version 2, December 2004
  4. *
  5. * Copyright (C) 2019 4sStylZ <4sstylz@protonmail.ch>
  6. *
  7. * Everyone is permitted to copy and distribute verbatim or modified
  8. * copies of this license document, and changing it is allowed as long
  9. * as the name is changed.
  10. *
  11. * DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
  12. * TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  13. *
  14. * 0. You just DO WHAT THE FUCK YOU WANT TO.
  15. */
  16. #include QMK_KEYBOARD_H
  17. /**
  18. * Macro for selecting all the text in the document.
  19. * Usual shortcut : Ctrl+A.
  20. *
  21. * @param keyrecord_t *record
  22. *
  23. * @return void
  24. */
  25. void select_all(keyrecord_t *record) {
  26. if (record->event.pressed) {
  27. tap_code16(C(KC_A));
  28. }
  29. }
  30. /**
  31. * Macro for selecting the current row.
  32. *
  33. * @param keyrecord_t *record
  34. *
  35. * @return void
  36. */
  37. void select_row(keyrecord_t *record) {
  38. if (record->event.pressed) {
  39. tap_code(KC_HOME);
  40. tap_code16(S(KC_END));
  41. }
  42. }
  43. /**
  44. * Macro for selecting the current word.
  45. * Usage : You need to have the cursor into the word or directly at the right.
  46. *
  47. *
  48. * Usual shortcut : Ctrl+A.
  49. *
  50. * @param keyrecord_t *record
  51. *
  52. * @return void
  53. */
  54. void select_word(keyrecord_t *record) {
  55. if (record->event.pressed) {
  56. register_code(KC_LCTL);
  57. tap_code(KC_LEFT);
  58. tap_code16(S(KC_RGHT));
  59. unregister_code(KC_LCTL);
  60. }
  61. }
  62. /**
  63. * Macro for inserting two 0 with keypad.
  64. * Be carefull to have the keypad lock enabled
  65. *
  66. * @param keyrecord_t *record
  67. *
  68. * @return void
  69. */
  70. void insert_00(keyrecord_t *record) {
  71. if (record->event.pressed) {
  72. tap_code16(S(KC_0));
  73. tap_code16(S(KC_0));
  74. }
  75. }
  76. /**
  77. * Bépo Windows lock
  78. *
  79. * @param keyrecord_t *record
  80. *
  81. * @return void
  82. */
  83. void windows_lock(void) {
  84. tap_code16(G(KC_O));
  85. }