detect alt-held character inputs; short-circuit menu bar shenanigans on chars-with-alt

This commit is contained in:
Ryan Fleury
2024-01-25 07:29:55 -08:00
parent 7cf0854178
commit 813554fa62
3 changed files with 204 additions and 196 deletions
+4
View File
@@ -493,6 +493,10 @@ w32_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if(character >= 32 && character != 127) if(character >= 32 && character != 127)
{ {
OS_Event *event = w32_push_event(OS_EventKind_Text, window); OS_Event *event = w32_push_event(OS_EventKind_Text, window);
if(lParam & bit29)
{
event->flags |= OS_EventFlag_Alt;
}
event->character = character; event->character = character;
} }
}break; }break;
+4
View File
@@ -167,6 +167,10 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
df_push_cmd__root(&params, spec); df_push_cmd__root(&params, spec);
df_gfx_request_frame(); df_gfx_request_frame();
os_eat_event(&events, event); os_eat_event(&events, event);
if(event->flags & OS_EventFlag_Alt)
{
window->menu_bar_focus_press_started = 0;
}
} }
} }
} }