print

nkrkv/hid/print

An HID keyboard character key sequence
print
@/print
An HID keyboard character key sequence
DEV@/keyboard
The keyboard device
Sstring
String to send like it was typed by a human. Note, the node knows nothing about the current OS language, Caps Lock state, and input focus. The print will be correct only when the EN layout with no Caps Lock is active.
DOpulse
Send the key sequence defined by `S` at the maximal possible rate.
print
DEV'
DONE
DEV
S
DO
DONEpulse
Pulses when the print is done
DEV'@/keyboard
To use the node in your project you should have the nkrkv/hid 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) {
    // Chain DEV to DEV'
    emitValue<output_DEVU0027>(ctx, getValue<input_DEV>(ctx));

    if (!isInputDirty<input_DO>(ctx))
        return;

    auto kb = getValue<input_DEV>(ctx);
    auto s = getValue<input_S>(ctx);

    for (auto it = s.iterate(); it; ++it)
        kb->write(*it);

    emitValue<output_DONE>(ctx, 1);
}