Amerio.Stephane Posted February 26, 2021 Posted February 26, 2021 (edited) 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 February 26, 2021 by Amerio.Stephane
silent Posted March 1, 2021 Posted March 1, 2021 Hi Stephane, Could you please elaborate what kind of task you are trying to achieve? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Amerio.Stephane Posted March 1, 2021 Author Posted March 1, 2021 Just showing/hiding the console through code
silent Posted March 2, 2021 Posted March 2, 2021 Yeah, there is a small bug in the setActive() method. We've already fixed it in our internal builds. Bug fix will be available in the upcoming 2.14 SDK update. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
artem.suravikin Posted May 17, 2021 Posted May 17, 2021 Hello, Is there any workaround to fix it in the version 2.13?
silent Posted May 17, 2021 Posted May 17, 2021 Hi Artem, I'm afraid there is no workaround available for this behavior since the bugged logic is deeply inside the engine sources (and there is no other methods with similar behavior that can be used instead). Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts