Disable system menu


photo

Recommended Posts

Posted (edited)

Hello,
Can I somehow disable showing system menu on ESC button press?

Edited by arzezniczak
Link to post

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!

  • Like 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to post
Posted (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 by arzezniczak
Link to post

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!

  • Like 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to post