Use CTRL+F to toggle Fullscreen for all window types

Main window and output windows use same keyboard shortcut for uniformity.
This commit is contained in:
Bruno Herbelin
2023-04-03 23:38:59 +02:00
parent 6fcfc2da34
commit 04822346a6
3 changed files with 17 additions and 20 deletions

View File

@@ -1184,23 +1184,25 @@ void Control::sendOutputStatus(const IpEndpointName &remoteEndpoint)
void Control::keyboardCalback(GLFWwindow* w, int key, int, int action, int mods)
{
if (UserInterface::manager().keyboardAvailable() && !mods )
if (UserInterface::manager().keyboardAvailable())
{
int _key = layoutKey(key);
Control::manager().input_access_.lock();
if (_key >= GLFW_KEY_A && _key <= GLFW_KEY_Z) {
Control::manager().input_active[INPUT_KEYBOARD_FIRST + _key - GLFW_KEY_A] = action > GLFW_RELEASE;
Control::manager().input_values[INPUT_KEYBOARD_FIRST + _key - GLFW_KEY_A] = action > GLFW_RELEASE ? 1.f : 0.f;
if ( !mods ) {
int _key = layoutKey(key);
Control::manager().input_access_.lock();
if (_key >= GLFW_KEY_A && _key <= GLFW_KEY_Z) {
Control::manager().input_active[INPUT_KEYBOARD_FIRST + _key - GLFW_KEY_A] = action > GLFW_RELEASE;
Control::manager().input_values[INPUT_KEYBOARD_FIRST + _key - GLFW_KEY_A] = action > GLFW_RELEASE ? 1.f : 0.f;
}
else if (_key >= GLFW_KEY_KP_0 && _key <= GLFW_KEY_KP_EQUAL) {
Control::manager().input_active[INPUT_NUMPAD_FIRST + _key - GLFW_KEY_KP_0] = action > GLFW_RELEASE;
Control::manager().input_values[INPUT_NUMPAD_FIRST + _key - GLFW_KEY_KP_0] = action > GLFW_RELEASE ? 1.f : 0.f;
}
Control::manager().input_access_.unlock();
}
else if (_key >= GLFW_KEY_KP_0 && _key <= GLFW_KEY_KP_EQUAL) {
Control::manager().input_active[INPUT_NUMPAD_FIRST + _key - GLFW_KEY_KP_0] = action > GLFW_RELEASE;
Control::manager().input_values[INPUT_NUMPAD_FIRST + _key - GLFW_KEY_KP_0] = action > GLFW_RELEASE ? 1.f : 0.f;
}
else if (_key == GLFW_KEY_ESCAPE && action == GLFW_PRESS )
else if ( key == GLFW_KEY_F && action == GLFW_PRESS && mods == GLFW_MOD_CONTROL )
{
Rendering::manager().window(w)->exitFullscreen();
Rendering::manager().window(w)->toggleFullscreen();
}
Control::manager().input_access_.unlock();
}
}

View File

@@ -167,10 +167,8 @@ static void OutputWindowEvent( GLFWwindow *w, int button, int action, int)
// exit fullscreen if its the case
if (glfwGetWindowMonitor(w) != nullptr)
Rendering::manager().window(w)->exitFullscreen();
// show main window in DISPLAYS view to
// indicate how to manipulate output window
Mixer::manager().setView(View::DISPLAYS);
// show main window
else
Rendering::manager().mainWindow().show();
}
// for next double clic detection

View File

@@ -350,9 +350,6 @@ void UserInterface::handleKeyboard()
if (clipboard != nullptr && strlen(clipboard) > 0)
Mixer::manager().paste(clipboard);
}
else if (ImGui::IsKeyPressed( Control::layoutKey(GLFW_KEY_F), false )) {
Rendering::manager().mainWindow().toggleFullscreen();
}
else if (ImGui::IsKeyPressed( Control::layoutKey(GLFW_KEY_M), false )) {
Settings::application.widget.stats = !Settings::application.widget.stats;
}