X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fapp.cc;h=a03fd34f9bb703a80ad76ea5ac86dd5555fa6007;hp=03561049230e59a38537fd8a25fd51ce517e29ad;hb=512acaa2427ffa2ff19079f999bc2fcd7cd33925;hpb=d29eba477666f0753170d9ad549a4715ce071d04 diff --git a/src/app.cc b/src/app.cc index 0356104..a03fd34 100644 --- a/src/app.cc +++ b/src/app.cc @@ -500,9 +500,9 @@ void app_keyboard(int key, bool pressed) { unsigned int mod = app_get_modifiers(); - if(!debug_gui_key(key, pressed, mod)) { - // the debug gui indicated that we should ignore the event - return; + if(show_debug_gui && !(pressed && (key == '`' || key == 27))) { + debug_gui_key(key, pressed, mod); + return; // ignore all keystrokes when GUI is visible } if(pressed) { @@ -518,12 +518,12 @@ void app_keyboard(int key, bool pressed) } break; - case '\t': + case '`': show_debug_gui = !show_debug_gui; show_message("debug gui %s", show_debug_gui ? "enabled" : "disabled"); break; - case '`': + case 'm': app_toggle_grab_mouse(); show_message("mouse %s", app_is_mouse_grabbed() ? "grabbed" : "released"); break; @@ -592,9 +592,9 @@ void app_keyboard(int key, bool pressed) void app_mouse_button(int bn, bool pressed, int x, int y) { - if(!debug_gui_mbutton(bn, pressed, x, y)) { - // the debug GUI indicated we should ignore the event - return; + if(show_debug_gui) { + debug_gui_mbutton(bn, pressed, x, y); + return; // ignore mouse events while GUI is visible } prev_mx = x; @@ -620,9 +620,9 @@ static void mouse_zoom(float dx, float dy) void app_mouse_motion(int x, int y) { - if(!debug_gui_mmotion(x, y)) { - // the debug GUI indicated we should ignore the event - return; + if(show_debug_gui) { + debug_gui_mmotion(x, y); + return; // ignore mouse events while GUI is visible } int dx = x - prev_mx; @@ -649,6 +649,13 @@ void app_mouse_delta(int dx, int dy) } } +void app_mouse_wheel(int dir) +{ + if(show_debug_gui) { + debug_gui_wheel(dir); + } +} + void app_gamepad_axis(int axis, float val) { switch(axis) {