mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-21 07:09:59 +01:00
New Headless execution mode (DRAFT)
This commit is contained in:
@@ -1398,7 +1398,8 @@ void Control::keyboardCalback(GLFWwindow* w, int key, int, int action, int mods)
|
||||
{
|
||||
if (UserInterface::manager().keyboardAvailable())
|
||||
{
|
||||
if ( !mods ) {
|
||||
// keys without modifiers in any windows
|
||||
if (!mods) {
|
||||
int _key = layoutKey(key);
|
||||
Control::manager().input_access_.lock();
|
||||
if (_key >= GLFW_KEY_A && _key <= GLFW_KEY_Z) {
|
||||
@@ -1411,14 +1412,31 @@ void Control::keyboardCalback(GLFWwindow* w, int key, int, int action, int mods)
|
||||
}
|
||||
Control::manager().input_access_.unlock();
|
||||
}
|
||||
#if defined(APPLE)
|
||||
else if ( w != Rendering::manager().mainWindow().window() &&
|
||||
key == GLFW_KEY_F && action == GLFW_PRESS && mods == GLFW_MOD_SUPER )
|
||||
#else
|
||||
else if ( key == GLFW_KEY_F && action == GLFW_PRESS && mods == GLFW_MOD_CONTROL )
|
||||
#endif
|
||||
// keys with modifiers in non-main window
|
||||
else if ( w != Rendering::manager().mainWindow().window() )
|
||||
{
|
||||
Rendering::manager().window(w)->toggleFullscreen();
|
||||
#if defined(APPLE)
|
||||
if ( key == GLFW_KEY_F && action == GLFW_PRESS && mods == GLFW_MOD_SUPER )
|
||||
#else
|
||||
if ( key == GLFW_KEY_F && action == GLFW_PRESS && mods == GLFW_MOD_CONTROL )
|
||||
#endif
|
||||
{
|
||||
// toggle fullscreen on CTRL+F
|
||||
Rendering::manager().window(w)->toggleFullscreen();
|
||||
}
|
||||
#if defined(APPLE)
|
||||
else if ( key == GLFW_KEY_Q && action == GLFW_PRESS && mods == GLFW_MOD_SUPER )
|
||||
#else
|
||||
else if ( key == GLFW_KEY_Q && action == GLFW_PRESS && mods == GLFW_MOD_CONTROL )
|
||||
#endif
|
||||
{
|
||||
// Quit on CTRL+Q (if no main window)
|
||||
if (glfwGetWindowAttrib(Rendering::manager().mainWindow().window(), GLFW_VISIBLE)
|
||||
== GL_FALSE) {
|
||||
// close rendering manager = quit
|
||||
Rendering::manager().close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user