Console::setActive(true) doesn't work as expected


photo

Recommended Posts

Hello,

Tried this code to circumvent current limitation with keyboard handling in console management, but as explained in the code comments, it doesn't work as expected.

// Doesn't work. The console can be hidden, but never shown
if (App::clearKeyState(App::KEY_F1)) {
	Console::setActive(!Console::isActive());
}
// Doesn't work. The console cannot be opened with this.
// If the console is already open, then it will quick-close-open it again. (???)
if (App::clearKeyState(App::KEY_F2)) {
	Console::setActive(true);
}
// Works OK. Closes the console
if (App::clearKeyState(App::KEY_F3)) {
	Console::setActive(false);
}
// isActive Works ok, but strangely clearKeyState doesn't as it clearly auto-repeat keys
// based on OS setup. Shouldn't the key NOT auto-repeat? Or is there another fct for this behavior? 
if (App::clearKeyState(App::KEY_F4)) {
	Log::message("active=%d\n",Console::isActive());
}

Also, Console::run("show"); doesn't work either.

Can you advise?

Edited by Amerio.Stephane
Link to post

Just showing/hiding the console through code

Link to post