ofAppNoWindow keypressed

I’m running OF on a Raspberry Pi 4 (Raspbian Lite) that is used to control LED matrixes. Therefore I’d like to run in headless mode with ofAppNoWindow. But for debugging it would be nice if I could still detect keypresses so I can shut down the application. So far I’ve had no luck getting the key detection to work, even though it seems like it should work as I find use cases on github. Any pointers on how to go about this?

#include "ofMain.h"
#include "ofApp.h"
#include "ofAppNoWindow.h" 

//========================================================================
int main( ){
    ofAppNoWindow window;  
    ofSetupOpenGL(&window,1024,768,OF_WINDOW);  

    ofRunApp(new ofApp());  
}

Trying to use the basic void ofApp:keyPressed(int key) function for detection at the moment.

I did it successfully with ofxNcurses from Tim. With a window ofApp, and a no window ofApp inside the same program (as in multiWindowExample)

There is no example for a no window app, but i think can be achieved without window.

So I actually fixed it a few days down the line.
Added a signal method that triggers ofExit() in the ofApp::update() loop.

    signal(SIGINT, ofExit); // Listens for ctrl-C and triggers exit.

Using this allows to quit even an ofAppNoWindow application on Raspberry Pi through the terminal by using control-C.

Cheers!