J2Kbr / GtunerIV

Gtuner IV - Titan Two's software bug report.
http://www.consoletuner.com
25 stars 4 forks source link

Add native mouse wheel function #398

Closed PablosScripts closed 3 years ago

PablosScripts commented 3 years ago

I use the following custom function to use the scroll wheel (differentiating between scroll up and down), I think this should be a native function, I don't think users should have to write it themselves in order to make use of what is a standard feature on 100% of mice (forgive me if this has already been implemented, I haven't looked in a while):

void mouse_wheel() {
    int8   wheel;
    uint32 tstamp;

    if(mouse_status(MREPORT_UPDATED)) {
        if(wheel = mouse_status(MOUSE_WHEEL)) {
            tstamp = mouse_status(MREPORT_TIMESTAMP);
            if(wheel != scrollDir || tstamp > scrollTstamp + TLIMIT) {
                scrollDir = wheel;
                if(wheel == 1) {
                    //combo_run(SecondaryForce);
                }           
                if(wheel == -1) {
                    //combo_run(PrimaryForce);
                }
            }
            scrollTstamp = tstamp;
        }
    }
}
J2Kbr commented 3 years ago

Hello Pablo, nice hearing from you. Hope you are doing good.

This feature is already implemented, as the following:

mouse_status(MWHEEL_FORWARD)

mouse_status(MWHEEL_BACKWARD)