Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool mousejump_l = false;
- bool mousejump_r = false;
- bool mousejump_u = false;
- bool mousejump_d = false;
- report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) {
- if (mousejump_l) {
- report_mouse_t currentReport = pointing_device_get_report();
- { currentReport.x = -5;
- }
- pointing_device_set_report(currentReport);
- pointing_device_send();
- }
- if (mousejump_r) {
- report_mouse_t currentReport = pointing_device_get_report();
- { currentReport.x = 5;
- }
- pointing_device_set_report(currentReport);
- pointing_device_send();
- }
- if (mousejump_u) {
- report_mouse_t currentReport = pointing_device_get_report();
- { currentReport.y = -5;}
- pointing_device_set_report(currentReport);
- pointing_device_send();
- }
- if (mousejump_d) {
- report_mouse_t currentReport = pointing_device_get_report();
- { currentReport.y = 5;
- }
- pointing_device_set_report(currentReport);
- pointing_device_send();
- }
- return mouse_report;
- }
- //add these in your macro section:
- enum custom_keycodes {
- MSEJL = SAFE_RANGE,
- MSEJR,
- MSEJU,
- MSEJD,
- };
- case MSEJL:
- if (record->event.pressed) {
- mousejump_l = true;
- } else {
- mousejump_l = false;
- }
- break;
- case MSEJR:
- if (record->event.pressed) {
- mousejump_r = true;
- } else {
- mousejump_r = false;
- }
- break;
- case MSEJU:
- if (record->event.pressed) {
- mousejump_u = true;
- } else {
- mousejump_u = false;
- }
- break;
- case MSEJD:
- if (record->event.pressed) {
- mousejump_d = true;
- } else {
- mousejump_d = false;
- }
- break;
- //put these in your keymap:
- MSEJL
- MSEJR
- MSEJU
- MSEJD
Advertisement
Add Comment
Please, Sign In to add comment