user: Provide the full official documentation entry for KeyMaps(bpy_struct), preserving all code examples.

assistant: # KeyMaps(bpy_struct)

base class — [`bpy_struct`](bpy.types.bpy_struct.html#bpy.types.bpy_struct "bpy.types.bpy_struct")

*class* bpy.types.KeyMaps(*bpy_struct*)
:   Collection of keymaps

    new(*name*, *\**, *space_type='EMPTY'*, *region_type='WINDOW'*, *modal=False*, *tool=False*)
    :   Ensure the keymap exists. This will return the one with the given name/space type/region type, or create a new one if it does not exist yet.

        Parameters:
        :   - **name** (*string**,* *(**never None**)*) – Name
            - **space_type** (enum in [Space Type Items](bpy_types_enum_items/space_type_items.html#rna-enum-space-type-items), (optional)) – Space Type
            - **region_type** (enum in [Region Type Items](bpy_types_enum_items/region_type_items.html#rna-enum-region-type-items), (optional)) – Region Type
            - **modal** (*boolean**,* *(**optional**)*) – Modal, Keymap for modal operators
            - **tool** (*boolean**,* *(**optional**)*) – Tool, Keymap for active tools

        Returns:
        :   Key Map, Added key map

        Return type:
        :   [`KeyMap`](bpy.types.KeyMap.html#bpy.types.KeyMap "bpy.types.KeyMap")

    remove(*keymap*)
    :   remove

        Parameters:
        :   **keymap** ([`KeyMap`](bpy.types.KeyMap.html#bpy.types.KeyMap "bpy.types.KeyMap"), (never None)) – Key Map, Removed key map

    clear()
    :   Remove all keymaps.

    find(*name*, *\**, *space_type='EMPTY'*, *region_type='WINDOW'*)
    :   find

        Parameters:
        :   - **name** (*string**,* *(**never None**)*) – Name
            - **space_type** (enum in [Space Type Items](bpy_types_enum_items/space_type_items.html#rna-enum-space-type-items), (optional)) – Space Type
            - **region_type** (enum in [Region Type Items](bpy_types_enum_items/region_type_items.html#rna-enum-region-type-items), (optional)) – Region Type

        Returns:
        :   Key Map, Corresponding key map

        Return type:
        :   [`KeyMap`](bpy.types.KeyMap.html#bpy.types.KeyMap "bpy.types.KeyMap")

    find_match(*keymap*)
    :   find_match

        Parameters:
        :   **keymap** ([`KeyMap`](bpy.types.KeyMap.html#bpy.types.KeyMap "bpy.types.KeyMap")) – Key Map, The key map for comparison

        Returns:
        :   Key Map, Corresponding key map

        Return type:
        :   [`KeyMap`](bpy.types.KeyMap.html#bpy.types.KeyMap "bpy.types.KeyMap")

    find_modal(*name*)
    :   find_modal

        Parameters:
        :   **name** (*string**,* *(**never None**)*) – Operator Name

        Returns:
        :   Key Map, Corresponding key map

        Return type:
        :   [`KeyMap`](bpy.types.KeyMap.html#bpy.types.KeyMap "bpy.types.KeyMap")

    *classmethod* bl_rna_get_subclass(*id*, *default=None*, */*)
    :   Parameters:
        :   **id** (*str*) – The RNA type identifier.

        Returns:
        :   The RNA type or default when not found.

        Return type:
        :   [`bpy.types.Struct`](bpy.types.Struct.html#bpy.types.Struct "bpy.types.Struct") subclass

    *classmethod* bl_rna_get_subclass_py(*id*, *default=None*, */*)
    :   Parameters:
        :   **id** (*str*) – The RNA type identifier.

        Returns:
        :   The class or default when not found.

        Return type:
        :   type