Guest User

Untitled

a guest
May 12th, 2025
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1.  
  2. bool mousejump_l = false;
  3. bool mousejump_r = false;
  4. bool mousejump_u = false;
  5. bool mousejump_d = false;
  6.  
  7. report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) {
  8. if (mousejump_l) {
  9. report_mouse_t currentReport = pointing_device_get_report();
  10. { currentReport.x = -5;
  11. }
  12. pointing_device_set_report(currentReport);
  13. pointing_device_send();
  14. }
  15. if (mousejump_r) {
  16. report_mouse_t currentReport = pointing_device_get_report();
  17. { currentReport.x = 5;
  18. }
  19. pointing_device_set_report(currentReport);
  20. pointing_device_send();
  21. }
  22. if (mousejump_u) {
  23. report_mouse_t currentReport = pointing_device_get_report();
  24. { currentReport.y = -5;}
  25. pointing_device_set_report(currentReport);
  26. pointing_device_send();
  27. }
  28. if (mousejump_d) {
  29. report_mouse_t currentReport = pointing_device_get_report();
  30. { currentReport.y = 5;
  31. }
  32. pointing_device_set_report(currentReport);
  33. pointing_device_send();
  34. }
  35. return mouse_report;
  36. }
  37.  
  38. //add these in your macro section:
  39.  
  40. enum custom_keycodes {
  41. MSEJL = SAFE_RANGE,
  42. MSEJR,
  43. MSEJU,
  44. MSEJD,
  45. };
  46.  
  47. case MSEJL:
  48. if (record->event.pressed) {
  49. mousejump_l = true;
  50. } else {
  51. mousejump_l = false;
  52. }
  53. break;
  54. case MSEJR:
  55. if (record->event.pressed) {
  56. mousejump_r = true;
  57. } else {
  58. mousejump_r = false;
  59. }
  60. break;
  61. case MSEJU:
  62. if (record->event.pressed) {
  63. mousejump_u = true;
  64. } else {
  65. mousejump_u = false;
  66. }
  67. break;
  68. case MSEJD:
  69. if (record->event.pressed) {
  70. mousejump_d = true;
  71. } else {
  72. mousejump_d = false;
  73. }
  74. break;
  75.  
  76. //put these in your keymap:
  77. MSEJL
  78. MSEJR
  79. MSEJU
  80. MSEJD
Advertisement
Add Comment
Please, Sign In to add comment