Change debug window binding to Shift + F12

This commit is contained in:
2026-01-03 15:48:13 +01:00
parent 323b04f542
commit 1cafe15917
4 changed files with 21 additions and 6 deletions

View File

@@ -444,6 +444,11 @@ driver_mode::on_key( int const Key, int const Scancode, int const Action, int co
// give the ui first shot at the input processing...
if( !anyModifier && true == m_userinterface->on_key( Key, Action ) ) { return; }
if (Key == (GLFW_MOD_SHIFT | GLFW_KEY_F12) && Action == GLFW_PRESS)
{
m_userinterface->showDebugUI();
return;
}
// ...if the input is left untouched, pass it on
if( true == m_input.keyboard.key( Key, Action ) ) { return; }

View File

@@ -87,6 +87,11 @@ void driver_ui::render_menu_contents() {
}
}
void driver_ui::showDebugUI()
{
m_debugpanel.is_open = !m_debugpanel.is_open;
}
// potentially processes provided input key. returns: true if key was processed, false otherwise
bool
driver_ui::on_key( int const Key, int const Action ) {
@@ -101,8 +106,7 @@ driver_ui::on_key( int const Key, int const Action ) {
case GLFW_KEY_F10:
case GLFW_KEY_F12: { // ui mode selectors
if( ( true == Global.ctrlState )
|| ( true == Global.shiftState ) ) {
if( ( true == Global.ctrlState )) {
// only react to keys without modifiers
return false;
}
@@ -157,10 +161,13 @@ driver_ui::on_key( int const Key, int const Action ) {
return true;
}
case GLFW_KEY_F12: {
case GLFW_KEY_F12 : {
// debug panel
m_debugpanel.is_open = !m_debugpanel.is_open;
return true;
if (Global.shiftState)
{
m_debugpanel.is_open = !m_debugpanel.is_open;
return true;
}
}
default: {

View File

@@ -27,6 +27,7 @@ public:
// constructors
driver_ui();
// methods
void showDebugUI() override;
// potentially processes provided input key. returns: true if the input was processed, false otherwise
bool
on_key( int const Key, int const Action ) override;
@@ -43,6 +44,7 @@ public:
protected:
void render_menu_contents() override;
private:
// methods
// sets visibility of the cursor

View File

@@ -75,13 +75,14 @@ public:
// destructor
virtual ~ui_layer();
// methods
// methods
static bool init( GLFWwindow *Window );
static void imgui_style();
// assign texturing hardware unit
static void set_unit( GLint const Textureunit ) { m_textureunit = GL_TEXTURE0 + Textureunit; }
static void shutdown();
virtual void showDebugUI() {};
// potentially processes provided input key. returns: true if the input was processed, false otherwise
virtual bool on_key( int Key, int Action );
// potentially processes provided mouse movement. returns: true if the input was processed, false otherwise