Handle menu-bar when flattening keymaps.
Flatten keymaps