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.

159 lines
3.0 KiB

  1. #include "d4mation.h"
  2. #include "tap-hold.h"
  3. #include "zalgo.h"
  4. #include "macros.h"
  5. bool zalgo_enabled = false;
  6. bool process_record_user( uint16_t keycode, keyrecord_t *record ) {
  7. switch ( keycode ) {
  8. case _GRAVE_ESC:
  9. /* Send ` on Tap, Esc on Hold */
  10. tap_or_hold( record, KC_GRAVE, KC_ESC );
  11. return false;
  12. break;
  13. case PHPOPEN:
  14. if ( record->event.pressed ) {
  15. tap_code16( S( KC_COMMA ) );
  16. tap_code16( S( KC_SLASH ) );
  17. tap_code( KC_P );
  18. tap_code( KC_H );
  19. tap_code( KC_P );
  20. }
  21. return false;
  22. break;
  23. case PHPCLSE:
  24. if ( record->event.pressed ) {
  25. tap_code16( S( KC_SLASH ) );
  26. tap_code16( S( KC_DOT ) );
  27. }
  28. return false;
  29. break;
  30. #ifdef UNICODE_ENABLE
  31. case AMENO: /* ༼ つ ◕_◕ ༽つ */
  32. if ( record->event.pressed ) {
  33. send_unicode_hex_string( "0F3C 0020 3064 0020 25D5 005F 25D5 0020 0F3D 3064" );
  34. }
  35. return false;
  36. break;
  37. case MAGIC: /* (∩ ͡° ͜ʖ ͡°)⊃━☆゚. * */
  38. if ( record->event.pressed ) {
  39. send_unicode_hex_string( "0028 2229 0020 0361 00B0 0020 035C 0296 0020 0361 00B0 0029 2283 2501 2606 FF9F 002E 0020 002A" );
  40. }
  41. return false;
  42. break;
  43. case LENNY: /* ( ͡° ͜ʖ ͡°) */
  44. if ( record->event.pressed ) {
  45. send_unicode_hex_string( "0028 0020 0361 00B0 0020 035C 0296 0020 0361 00b0 0029" );
  46. }
  47. return false;
  48. break;
  49. case DISFACE: /* ಠ_ಠ */
  50. if ( record->event.pressed ) {
  51. send_unicode_hex_string( "0CA0 005F 0CA0" );
  52. }
  53. return false;
  54. break;
  55. case TFLIP: /* (╯°□°)╯ ︵ ┻━┻ */
  56. if ( record->event.pressed ) {
  57. send_unicode_hex_string( "0028 256F 00b0 25A1 00B0 0029 256F FE35 253B 2501 253B" );
  58. }
  59. return false;
  60. break;
  61. case TPUT: /* ┬──┬ ノ( ゜-゜ノ) */
  62. if ( record->event.pressed ) {
  63. send_unicode_hex_string( "252C 2500 2500 252C 0020 30CE 0028 0020 309C 002D 309C 30CE 0029" );
  64. }
  65. return false;
  66. break;
  67. case SHRUG: /* ¯\_(ツ)_/¯ */
  68. if ( record->event.pressed ) {
  69. send_unicode_hex_string( "00AF 005C 005F 0028 30C4 0029 005F 002F 00AF" );
  70. }
  71. return false;
  72. break;
  73. case ZALGO: /* Toggles Zalgo Text mode */
  74. if ( record->event.pressed ) {
  75. zalgo_enabled = ! zalgo_enabled;
  76. }
  77. return false;
  78. break;
  79. #endif
  80. default:
  81. #ifdef UNICODE_ENABLE
  82. if ( zalgo_enabled ) {
  83. if ( keycode < KC_A || ( keycode > KC_0 && keycode < KC_MINUS ) || keycode > KC_SLASH ) {
  84. process_record_keymap( keycode, record );
  85. return true;
  86. }
  87. if ( record->event.pressed ) {
  88. zalgo_text( keycode );
  89. }
  90. return false;
  91. }
  92. #endif
  93. break;
  94. }
  95. process_record_keymap( keycode, record );
  96. return true;
  97. };