How to create a keyboard shortcut to call a custom menu in a floating window with Python?
Just set the keymap item identifier to WindowManager.call_menu and assign bl_idname of the menu to the name property. Basic example on how create a shortcut to call a menu using CtrlW:

import bpy

class SimpleCustomMenu(bpy.types.Menu):
    bl_label = &quot;Simple Custom Menu&quot;
    bl_idname = &quot;OBJECT_MT_simple_custom_menu&quot;

    def draw(self, context):
        layout = self.layout
        layout.operator(&quot;wm.open_mainfile&quot;)
        layout.operator(&quot;wm.save_as_mainfile&quot;)

addon_keymaps = []

def register():
    bpy.utils.register_class(SimpleCustomMenu)
    
    wm = bpy.context.window_manager
    kc = wm.keyconfigs.addon
    if kc:
        km = wm.keyconfigs.addon.keymaps.new(name='3D View', space_type='VIEW_3D')
        kmi = km.keymap_items.new('wm.call_menu', 'W', 'PRESS', ctrl=True, shift=False, alt=False)
        kmi.properties.name =  SimpleCustomMenu.bl_idname
        addon_keymaps.append((km, kmi))

def unregister():
    bpy.utils.unregister_class(SimpleCustomMenu)
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()

if __name__ == &quot;__main__&quot;:
    register()

Related: Create keyboard shortcut for an operator using python?