gettouchxy

ivanmason/gt9271/gettouchxy

Output touch location
gettouchxy
@/gettouchxy
Output touch location
TLOC@/touchlocation
TNUMnumber
TOUCHboolean
UPDpulse
gettouchxy
X
Y
DONE
TLOC
TNUM
TOUCH
UPD
DONEpulse
Ynumber
Xnumber
To use the node in your project you should have the ivanmason/gt9271 library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    if (!isInputDirty<input_UPD>(ctx))
        return;
    if(getValue<input_TOUCH>(ctx)){
        auto pLoc = getValue<input_TLOC>(ctx);
        uint8_t num = getValue<input_TNUM>(ctx);
        emitValue<output_X>(ctx, (uint16_t)pLoc.x[num]);
        emitValue<output_Y>(ctx, (uint16_t)pLoc.y[num]);
    }
    emitValue<output_DONE>(ctx, 1);
}