OS6 equivalent to kbit() or _kbhit()?

For some simple applications, I’ve used a familiar construct, like what you see below:

I tried this, but on the first keystroke, it remains in the while (_kbhit() ), and never after runs the normal code path.

static BufferedSerial pc(USBTX, USBRX, 460800);

while (true) {
    while (_kbhit()) {
        int c = getc();
        switch (c) {
            case '?': EmitMenu(); break;
            case 'P': PowerOn(); break;
        }
    }
    // normal code path
    // ... until the first keystroke, then never again...
}

What is the equivalent in OS6 that I’m missing here?

OS6 - Cloud Compiler, Target LPC1`768, USB Debug port …

Hi David,

I found this article which might help:

The suggested answers structure the code differently (assuming you want to wait for a keypress). Let me know if this answer solves your problem.

Regards
Anna