Jump to content

Replace system menu


photo

Recommended Posts

How can I change the system menu, which is called by pressing ESC?
I would like to show the user my menu.

In order to check the button pressing I use this function:

bool Utils::checkKeyPressed(int _key)
{
    if (Console::get()->getActivity())
    {
        return false;
    }

    if (App::get()->getKeyState(_key))
    {
        App::get()->clearKeyState(_key);
        return true;
    }

    return false;
}

This feature correctly displays the pressing of many keys but does not operate when pressing ESC

void MainGui::update()
{
    if (!gui)
    {
        init();
    }

    if(Utils::checkKeyPressed(App::KEY_ESC))
    {
        static int i = 0;
        Log::message("Esc pressed %d\n", i++);
    }
}

What am I doing wrong? How to catch the ESC  key pressing and cancel the display of the standard system menu?

Link to comment

Hi,

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.

Please, refer also to the following forum threads:

Thanks!

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

Link to comment

I pass -extern_define MENU_USER as argument to engine and this helps to handle ESC button.

But how i can show/hide this system menu from my cpp code?

Can I modify system menu? I try modify <sdk\data\core\scripts\system\system.h>, but it has no effect.

 

Edited by neborak_a
Link to comment
×
×
  • Create New...