Hi
im running latest alpha of BTT on monterey
i figured out to log all buttons but they dont show up in provided triggers. am i missing something
i closed and open analyse window few times to repeat process
i will only use thumb button for mission control. it working that way if i connect with dongle but its works as page up on bluetooth connection. just weird choice from logitech
i tried to put callBTT('trigger_action',{json:{BTTPredefinedActionType:5}})
code on thumb statement to try my luck it didnt worked, it would be cool
here is code
// Enter your input analyzer script here.
// Do not change the function signatures
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).
b=(index,bytes)=>(reportBuffer.readUInt8(index)===bytes)
if(b(1,0x01) && b(0,0x02)){
log('Left');
bttTriggerDeviceTrigger(targetDevice,'Left');
}else if(b(1,0x02)){
log('Right');
bttTriggerDeviceTrigger(targetDevice,'Right');
}else if(b(1,0x04)){
log('Middle');
bttTriggerDeviceTrigger(targetDevice,'Middle');
}else if(b(1,0x10)){
log('Forward');
bttTriggerDeviceTrigger(targetDevice,'Forward');
}else if(b(1,0x08)){
log('Backward');
bttTriggerDeviceTrigger(targetDevice,'Backward');
}else if(b(6,0x01)){
log('Scroll Up');
bttTriggerDeviceTrigger(targetDevice,'ScrollUp');
}else if(b(6,0xff)){
log('Scroll Down');
bttTriggerDeviceTrigger(targetDevice,'ScrollDown');
}else if(b(7,0x01)){
log('Scroll Right');
bttTriggerDeviceTrigger(targetDevice,'ScrollRight');
}else if(b(7,0xff)){
log('Scroll Left');
bttTriggerDeviceTrigger(targetDevice,'ScrollLeft');
}else if(b(2,0x52)){
log('Thumb');
bttTriggerDeviceTrigger(targetDevice,'Thumb');
}
}
// Advanced, optional. Use if you want to trigger commands that send data to
// the device, from a BTT predefined action.
// See https://docs.folivora.ai/1500_generic_devices.html
async function executeBTTCommand(targetDevice, commandName, commandInput) {
log("execute command: " + commandName)
switch(commandName) {
case "exampleCommand": {
// send any hex string to the device
let deviceResponse = await bttSendDataToDevice({
BTTActionSendDataTargetDevice: targetDevice,
BTTActionSendDataData: 'FEEDC0DE',
BTTActionSendDataReportType: 1,
BTTActionSendDataResponseType: -1,
BTTActionSendDataResponsePrefix: ''
});
break;
}
}
return 'done executing ' + commandName
}