Browse Source

use command on OSX instead of control, some back button debug

master
Odilitime 5 years ago
parent
commit
fabd69f40f
  1. 16
      src/graphics/opengl/Window.cpp

16
src/graphics/opengl/Window.cpp

@ -109,12 +109,17 @@ bool Window::init() { @@ -109,12 +109,17 @@ bool Window::init() {
navBackButton->uiControl.w = { 0, 32 }; // 32px
navBackButton->uiControl.h = { 0, 32 }; // 32px
navBackButton->onClick=[this]() {
//std::cout << "Back" << std::endl;
std::cout << "Window::init.navBackButton->onClick - Back" << std::endl;
TabbedComponent *pTabComponent = dynamic_cast<TabbedComponent*>(this->tabComponent.get());
if (pTabComponent) {
if (pTabComponent->selectedTabId) {
pTabComponent->selectedTab->get()->history->print();
pTabComponent->selectedTab->get()->history->back();
} else {
std::cout << "Window::init.navBackButton->onClick - no tab selected" << std::endl;
}
} else {
std::cout << "Window::init.navBackButton->onClick - no tabbed component" << std::endl;
}
};
navBackButton->onMouseover = [navBackButton, this]() {
@ -454,7 +459,14 @@ bool Window::initGLFW() { @@ -454,7 +459,14 @@ bool Window::initGLFW() {
glfwSetKeyCallback(window, [](GLFWwindow *win, int key, int scancode, int action, int mods) {
Window *thiz = reinterpret_cast<Window*>(glfwGetWindowUserPointer(win));
//std::cout << "Key " << key << " action: " << action << "mods: " << mods << std::endl;
if (key == GLFW_KEY_N && action == GLFW_RELEASE && mods == GLFW_MOD_CONTROL) {
// command for OSX, otherwise control
#if defined(__APPLE__) && defined(__MACH__)
int attentionMod = GLFW_MOD_SUPER;
#else
int attentionMod = GLFW_MOD_CONTROL;
#endif
if (key == GLFW_KEY_N && action == GLFW_RELEASE && mods == attentionMod) {
browser->addWindow();
return;
}

Loading…
Cancel
Save