ItzSwirlz / Ristretto

Enabling home automation on the Wii U
4 stars 1 forks source link

[Feature Request] Handle remote inputs #7

Closed ItzSwirlz closed 1 month ago

ItzSwirlz commented 2 months ago

We can make support the equivalent of the "Remote" functionality, as seen in HomeKit for example. Below is a screenshot from Reddit of what this looks like: image

We can hook VPADRead and do something like this:

DECL_FUNCTION(int32_t, VPADRead, VPADChan chan, VPADStatus *buffers, uint32_t count, VPADReadError *outError) {
    int result = real_VPADRead(chan, buffers, count, outError);
    if(inject) {
        inject = false;
        buffers->hold = VPAD_BUTTON_A; // "A"
    }
    return result;
}

This will be for the later versions of Ristretto.

ItzSwirlz commented 1 month ago

Added in commit https://github.com/ItzSwirlz/Ristretto/commit/758868ae1ed2f9345dd287461988c85e3a7f6c7d - fixed with https://github.com/ItzSwirlz/Ristretto/commit/9994d77f805c1845b5719f137ca47f3270423bb0 - implemented in homebridge-wiiu with https://github.com/ItzSwirlz/homebridge-wiiu/commit/6802c6cad0f75c59353baa1a912241a60fe14169