small improve

This commit is contained in:
Jinhao 2018-03-07 11:27:31 +08:00
parent 457d86aa39
commit bdc480953e

View File

@ -352,11 +352,16 @@ namespace detail
} }
void process_msg(bedrock* brock, MSG& msg) void process_msg(bedrock* brock, MSG& msg)
{
if (WM_KEYFIRST <= msg.message && msg.message <= WM_KEYLAST)
{ {
auto misc = brock->wd_manager().root_runtime(reinterpret_cast<native_window_type>(msg.hwnd)); auto misc = brock->wd_manager().root_runtime(reinterpret_cast<native_window_type>(msg.hwnd));
if (misc && misc->wpassoc && misc->wpassoc->accel)
if (misc && misc->wpassoc->accel && ::TranslateAccelerator(msg.hwnd, misc->wpassoc->accel, &msg)) {
if (::TranslateAccelerator(msg.hwnd, misc->wpassoc->accel, &msg))
return; return;
}
}
auto menu_wd = brock->get_menu(reinterpret_cast<native_window_type>(msg.hwnd), true); auto menu_wd = brock->get_menu(reinterpret_cast<native_window_type>(msg.hwnd), true);
if (menu_wd) interior_helper_for_menu(msg, menu_wd); if (menu_wd) interior_helper_for_menu(msg, menu_wd);