How to create a keyboard shortcut to call a custom menu in a floating window with Python? This is very simple script example from Blender templates:
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;)


def register():
    bpy.utils.register_class(SimpleCustomMenu)


def unregister():
    bpy.utils.unregister_class(SimpleCustomMenu)


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

    # The menu can also be called from scripts
    bpy.ops.wm.call_menu(name=SimpleCustomMenu.bl_idname)

All I care about is the ability opening the menu in separate floating window without need to go thru menu all the time, as I have my own code (add-on) and trying to implement this (no success yet - I am still scripting newbie, so you know).
Thus merit of my question is: how can we make what line bpy.ops.wm.call_menu(name=SimpleCustomMenu.bl_idname) is doing with hardcoded keyboard shortcut right in the script itslef?
Like: when I press, let's say, Shift+Q it would open that small floating window with my menu - anyone with a working example script based on the code above?
I DID TRY several ways, but still I was unable making it work, that is reason why I would like to see actual working code, not just some kind of statement (I saw such statements already and they were of no help at all to me).
EDIT: I reformated my question so it would be clear to everyone what I mean (sorry, english is not my native language)
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?