ofGetKeyPressed COMMAND doesn't work inside addon, depending on main.cpp

Hello, I’m not sure if filling an issue or not. After researching a lot why sometimes my addon ofxDmtrUI


doesn’t capture ofGetKeyPressed(OF_KEY_COMMAND) at all, and I recently found it.

If I use this syntax in main.app it doesn’t work

#include "ofMain.h"
#include "ofApp.h"
#include "ofAppGlutWindow.h"

//========================================================================
int main( ){

    ofAppGlutWindow window;
	ofSetupOpenGL(&window, 520,720, OF_WINDOW);			// <-------- setup the GL context

	// this kicks off the running of my app
	// can be OF_WINDOW or OF_FULLSCREEN
	// pass in width and height too:
	ofRunApp( new ofApp());

}

but this one works great

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

//========================================================================
int main( ){
	ofSetupOpenGL(520,720,OF_WINDOW);			// <-------- setup the GL context

	// this kicks off the running of my app
	// can be OF_WINDOW or OF_FULLSCREEN
	// pass in width and height too:
	ofRunApp(new ofApp());

}

Anybody knows why is that? Hope it can help anybody else too.

glut window is deprecated so better to use the second syntax anyway which is the default since a couple of major versions

1 Like

super, thank you @arturo