restrict menu bar keyboard shortcuts to being modifierless

This commit is contained in:
Ryan Fleury
2024-01-25 07:47:11 -08:00
parent 813554fa62
commit 76b2facbf4
2 changed files with 4 additions and 6 deletions
+4 -4
View File
@@ -186,7 +186,7 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
continue; continue;
} }
B32 take = 0; B32 take = 0;
if(event->kind == OS_EventKind_Press && event->key == OS_Key_Alt && event->is_repeat == 0) if(event->kind == OS_EventKind_Press && event->key == OS_Key_Alt && event->flags == 0 && event->is_repeat == 0)
{ {
take = 1; take = 1;
df_gfx_request_frame(); df_gfx_request_frame();
@@ -194,19 +194,19 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
ws->menu_bar_key_held = 1; ws->menu_bar_key_held = 1;
ws->menu_bar_focus_press_started = 1; ws->menu_bar_focus_press_started = 1;
} }
if(event->kind == OS_EventKind_Release && event->key == OS_Key_Alt && event->is_repeat == 0) if(event->kind == OS_EventKind_Release && event->key == OS_Key_Alt && event->flags == 0 && event->is_repeat == 0)
{ {
take = 1; take = 1;
df_gfx_request_frame(); df_gfx_request_frame();
ws->menu_bar_key_held = 0; ws->menu_bar_key_held = 0;
} }
if(ws->menu_bar_focused && event->kind == OS_EventKind_Press && event->key == OS_Key_Alt && event->is_repeat == 0) if(ws->menu_bar_focused && event->kind == OS_EventKind_Press && event->key == OS_Key_Alt && event->flags == 0 && event->is_repeat == 0)
{ {
take = 1; take = 1;
df_gfx_request_frame(); df_gfx_request_frame();
ws->menu_bar_focused = 0; ws->menu_bar_focused = 0;
} }
else if(ws->menu_bar_focus_press_started && !ws->menu_bar_focused && event->kind == OS_EventKind_Release && event->key == OS_Key_Alt && event->is_repeat == 0) else if(ws->menu_bar_focus_press_started && !ws->menu_bar_focused && event->kind == OS_EventKind_Release && event->flags == 0 && event->key == OS_Key_Alt && event->is_repeat == 0)
{ {
take = 1; take = 1;
df_gfx_request_frame(); df_gfx_request_frame();
-2
View File
@@ -85,8 +85,6 @@
// [ ] escaping in config files - breakpoint labels etc. // [ ] escaping in config files - breakpoint labels etc.
// [ ] focus changing between query bar & panel content via mouse // [ ] focus changing between query bar & panel content via mouse
// //
// [ ] ** while typing, "Alt" Windows menu things should not happen
//
// [ ] visualize conversion failures // [ ] visualize conversion failures
// //
// [ ] I was a little confused about what a profile file was. I understood // [ ] I was a little confused about what a profile file was. I understood