arzezniczak Posted June 1, 2021 Share Posted June 1, 2021 (edited) Hello, Can I somehow disable showing system menu on ESC button press? Edited June 1, 2021 by arzezniczak Link to comment
silent Posted June 1, 2021 Share Posted June 1, 2021 arzezniczak There is a section in core system script that handles the ESC key pressing (data/core/scripts/system/system.h). You can pass MENU_USER define on engine start-up to disable menu by ESC (-extern_define MENU_USER). Thanks! 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
arzezniczak Posted June 1, 2021 Author Share Posted June 1, 2021 (edited) I've tried with -exter_define MENU_USER and it works - system menu is not showing now. But now there is another problem. In AppWorldLogic::init I've setup ESC key as STATE_AUX_0: ControlsApp::setStateKey( Controls::STATE_AUX_0, App::KEY_ESC ); I'm checking if this state is true with this line of code in AppWorldLogic::update: if ( controls->clearState( Controls::STATE_AUX_0 ) ) But it's never gets true. I think something is still consuming ESC key press state. Edited June 1, 2021 by arzezniczak Link to comment
silent Posted June 2, 2021 Share Posted June 2, 2021 Looks like STATE_AUX* is being force skipped for Esc button (it's hard to say currently why it's being done like this). Long story short: you can't use STATE_AUX* with Esc button. Following code should work fine: if (Input::isKeyPressed(Input::KEY_ESC)) Log::message("Input::isKeyPressed\n"); if (App::clearKeyState(App::KEY_ESC)) Log::message("App::clearKeyState\n"); Thanks! 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
arzezniczak Posted June 2, 2021 Author Share Posted June 2, 2021 Thank you, it works! 1 Link to comment
Recommended Posts