Defined in:Sets the callback function that is invoked when the console key is pressed.
void SetConsoleCallback(KeyCallback *callback, void *cookie = nullptr);
||A pointer to the callback function that is invoked when the console key is pressed.|
||A user-defined value that is passed to the console callback function.|
SetConsoleCallbackfunction sets the callback function that is invoked whenever the console key is pressed and the keyboard is in game input mode to that given by the
cookieparameter specifies a user-defined value that is passed through to the console callback function.
By default, the engine installs a console callback function that opens the built-in console window.
Before changing the current console callback function with the
SetConsoleCallbackfunction, the previous console callback function and its cookie can be retrieved by calling the
InputMgr::GetConsoleCookiefunctions. The values returned by these two functions can be saved and later restored by passing them back to the
nullptr, then any current console callback function is removed, and no new console callback function is installed. In this case, pressing the console key when the keyboard is in game input mode has no effect.
SetConsoleCallbackfunction has no effect on whether the console can be opened when the keyboard is in interface event mode. To enable and disable the console in interface event mode, call the