noah-nuebling / mac-mouse-fix

Mac Mouse Fix - Make Your $10 Mouse Better Than an Apple Trackpad!
https://macmousefix.com/
Other
5.46k stars 153 forks source link

Kensington Slimblade top buttons support [enhancement] #896

Open joonhyuk opened 6 months ago

joonhyuk commented 6 months ago

Description

Kensington trackballs have two top buttons but they only works with Kensington Works(very shitty app) or, the SteerMouse app. It would be nice if Mac Mouse Fix support them.

Rationale

HW : Kensington Slimblade OS : Sonoma 14.4 Problem : Two top buttons(button 3, 4) not working

Additional info

VID : 0x47D PID : 0x2041

below javascript is for parsing button in BTT. Hope it helpful!

function analyzeDeviceInput(targetDevice, reportID, reportDataHex) {

    let reportBuffer = buffer.Buffer.from(reportDataHex, 'hex');
    // the values you see above are in hex format. To read such a byte
    // use readUInt8(index).
    if(reportBuffer.readUInt8(0) === 0x03) {
        bttTriggerDeviceTrigger(targetDevice, 'button3');
    }
    if(reportBuffer.readUInt8(4) === 0x01) {
        bttTriggerDeviceTrigger(targetDevice, 'button4');
    } else if(reportBuffer.readUInt8(4) === 0x02) {
        bttTriggerDeviceTrigger(targetDevice, 'button5');
    } else if(reportBuffer.readUInt8(4) === 0x03) {
        bttTriggerDeviceTrigger(targetDevice, 'button6');
    }
    // If you want to get the next report even though,
    // the data has not changed, call this function:
    // bttGetNextEvenWithoutChange(targetDevice, reportID)
}
billbonney commented 2 months ago

The Kensington software is not needed. Mac Mouse Fix replaces their rubbish software. The default mouse driver from app gives you the full 7 buttons.

If I have the Kensington software installed, I only see 5 buttons on my Vertical Trackball Mouse. If I have no Kensington software installed I get the full 7 buttons.

FIX: You need to make sure the KensingtonWorksHelper driver is removed. There is an uninstaller script/app you can run.