Is there a way to prevent recursive triggers with generic devices?

I noticed that when using Parse Device Input/Output to monitor Input Data, the same byte change is often reported back multiple times per button press (like when pressing a button using an xbox controller for example). Is there a way to prevent recursive triggers for generic devices? This would save a lot of headache, as it is often unusable due to this. Thank you

I think I'm not really sure what you mean by recursive trigger in this context. Do you have a concrete example?

I'm pretty sure it can be solved because you can do with the bytes whatever you want. You do not need to trigger an action on every byte change. By default BTT wouldn't even notify about the next received byte sequence if it hasn't changed (unless you call bttGetNextEvenWithoutChange(targetDevice, reportID)
)

So for example, I have a play/pause action that is supposed to be triggered everytime I click in the right joystick on an xbox controller.

I have this code set for the byte that I am interested in monitoring for this change:
if(reportBuffer.readUInt8(15) === 0x40) {
log('R3');
bttTriggerDeviceTrigger(targetDevice, 'R3');

The problem is that the joystick is very sensitive around its axis. So many other bytes that I am not interested in monitoring (for this specific action) change, causing BTT to report many changes in byte sequence before the byte I want to monitor returns back to 00 (ie. before I can lift my thumb/unclick the joystick). This causes my play/pause action to be triggered repeatedly during one click.

I hope that made sense.

but BTT only monitors the bytes you selected (clicked) in the UI, do you maybe have some of the changing bytes selected by accident?

I have purposefully selected those other bytes, as I monitor them to trigger some other actions actions when the bytes change to specific values (for example if the stick is moved fully forward or backward, fully left or right. Specific bytes are reported for those positions).

I can deselect those in the UI, but then I guess I'll have to stop using those.

You don't need to remove them, but you need to add some custom code to ignore them unless needed.

You'd basically need to store the previous state and compare it to the new received. You can easily define variables outside of the analyzeDeviceInput function to store such state. Here is a simple example:

var previousButtonState = -1;
function analyzeDeviceInput(targetDevice, reportID, reportDataHex) {
    let reportBuffer = buffer.Buffer.from(reportDataHex, 'hex');
    let newButtonState = reportBuffer.readUInt8(1);
    if(newButtonState !== previousButtonState) {
       //only trigger on change of specific byte
    }

    previousButtonState = newButtonState;

    bttGetNextEvenWithoutChange(targetDevice, reportID)
}