16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 12:29:18 +02:00

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... // give the ui first shot at the input processing...
if( !anyModifier && true == m_userinterface->on_key( Key, Action ) ) { return; } 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 the input is left untouched, pass it on
if( true == m_input.keyboard.key( Key, Action ) ) { return; } 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 // potentially processes provided input key. returns: true if key was processed, false otherwise
bool bool
driver_ui::on_key( int const Key, int const Action ) { 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_F10:
case GLFW_KEY_F12: { // ui mode selectors case GLFW_KEY_F12: { // ui mode selectors
if( ( true == Global.ctrlState ) if( ( true == Global.ctrlState )) {
|| ( true == Global.shiftState ) ) {
// only react to keys without modifiers // only react to keys without modifiers
return false; return false;
} }
@@ -157,10 +161,13 @@ driver_ui::on_key( int const Key, int const Action ) {
return true; return true;
} }
case GLFW_KEY_F12: { case GLFW_KEY_F12 : {
// debug panel // debug panel
m_debugpanel.is_open = !m_debugpanel.is_open; if (Global.shiftState)
return true; {
m_debugpanel.is_open = !m_debugpanel.is_open;
return true;
}
} }
default: { default: {

View File

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

View File

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