qmk/qmk_firmware

[Feature Request] Different mouse sensitivity for each axis (for mousekeys feature)

Open

#26.110 aperta il 27 mar 2026

Vedi su GitHub
 (5 commenti) (2 reazioni) (0 assegnatari)C (43.867 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (20.368 star)
Metriche merge PR
 (Merge medio 20g 9h) (27 PR mergiate in 30 g)

Descrizione

Feature Request Type

  • Core functionality
  • Add-on hardware support (eg. audio, RGB, OLED screen, etc.)
  • Alteration (enhancement/optimization) of existing feature(s)
  • New behavior

Description

I am facing issue where the sensitivity of the y axis (up/down motion) is too sensitive, whereas the x axis movement is on the perfect speed.

The proposed solution is to add the MOUSEKEY_SENS_X and MOUSEKEY_SENS_Y to configure each axis sensitivity. It is done by multiplying the movement result, for example on the quantum/mousekey.c on mousekey_task() function with the default acceleration,

    if ((tmpmr.x || tmpmr.y) && timer_elapsed(last_timer_c) > (mousekey_repeat ? mk_interval : mk_delay * 10)) {
        if (mousekey_repeat != UINT8_MAX) mousekey_repeat++;
        if (tmpmr.x != 0) mouse_report.x = move_unit() * ((tmpmr.x > 0) ? 1 : -1) * MOUSEKEY_SENS_X;
        if (tmpmr.y != 0) mouse_report.y = move_unit() * ((tmpmr.y > 0) ? 1 : -1) * MOUSEKEY_SENS_Y;

        /* diagonal move [1/sqrt(2)] */
        if (mouse_report.x && mouse_report.y) {
            mouse_report.x = times_inv_sqrt2(mouse_report.x) * MOUSEKEY_SENS_X;
            if (mouse_report.x == 0) {
                mouse_report.x = 1;
            }
            mouse_report.y = times_inv_sqrt2(mouse_report.y * MOUSEKEY_SENS_Y);
            if (mouse_report.y == 0) {
                mouse_report.y = 1;
            }
        }
    }

So, for the example above, we let the MOUSEKEY_SENS_X be default 1.0 (because it is perfect already), and the MOUSEKEY_SENS_Y be 0.9 (because i need it a little less sensitive).

I already having the working code on my repo.. is it okay if i open a PR? thanks

Guida contributor