user: What is KeyMapItem(bpy_struct) and how is it used in Blender Python scripting?

assistant: # KeyMapItem(bpy_struct)

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

*class* bpy.types.KeyMapItem(*bpy_struct*)
:   Item in a Key Map

    active
    :   Activate or deactivate item

        Type:
        :   boolean, default False

    alt
    :   Alt key pressed, -1 for any state

        Type:
        :   int in [-1, 1], default 0

    alt_ui
    :   Alt key pressed

        Type:
        :   boolean, default False

    any
    :   Any modifier keys pressed

        Type:
        :   boolean, default False

    ctrl
    :   Control key pressed, -1 for any state

        Type:
        :   int in [-1, 1], default 0

    ctrl_ui
    :   Control key pressed

        Type:
        :   boolean, default False

    direction
    :   The direction (only applies to drag events)

        Type:
        :   enum in [Event Direction Items](bpy_types_enum_items/event_direction_items.html#rna-enum-event-direction-items), default `'ANY'`

    hyper
    :   Hyper key pressed, -1 for any state

        Type:
        :   int in [-1, 1], default 0

    hyper_ui
    :   Hyper key pressed. An additional modifier which can be configured on Linux, typically replacing CapsLock

        Type:
        :   boolean, default False

    id
    :   ID of the item

        Type:
        :   int in [-32768, 32767], default 0, (readonly)

    idname
    :   Identifier of operator to call on input event

        Type:
        :   string, default “”, (never None)

    is_user_defined
    :   Is this keymap item user defined (does not just replace a builtin item)

        Type:
        :   boolean, default False, (readonly)

    is_user_modified
    :   Is this keymap item modified by the user

        Type:
        :   boolean, default False, (readonly)

    key_modifier
    :   Regular key pressed as a modifier

        Type:
        :   enum in [Event Type Items](bpy_types_enum_items/event_type_items.html#rna-enum-event-type-items), default `'NONE'`

    map_type
    :   Type of event mapping

        Type:
        :   enum in [`'KEYBOARD'`, `'MOUSE'`, `'NDOF'`, `'TEXTINPUT'`, `'TIMER'`], default `'KEYBOARD'`

    name
    :   Name of operator (translated) to call on input event

        Type:
        :   string, default “”, (readonly, never None)

    oskey
    :   Operating system key pressed, -1 for any state

        Type:
        :   int in [-1, 1], default 0

    oskey_ui
    :   Operating system key pressed

        Type:
        :   boolean, default False

    properties
    :   Properties to set when the operator is called

        Type:
        :   [`OperatorProperties`](bpy.types.OperatorProperties.html#bpy.types.OperatorProperties "bpy.types.OperatorProperties"), (readonly)

    propvalue
    :   The value this event translates to in a modal keymap

        Type:
        :   enum in [Keymap Propvalue Items](bpy_types_enum_items/keymap_propvalue_items.html#rna-enum-keymap-propvalue-items), default `'NONE'`

    repeat
    :   Active on key-repeat events (when a key is held)

        Type:
        :   boolean, default False

    shift
    :   Shift key pressed, -1 for any state

        Type:
        :   int in [-1, 1], default 0

    shift_ui
    :   Shift key pressed

        Type:
        :   boolean, default False

    show_expanded
    :   Show key map event and property details in the user interface

        Type:
        :   boolean, default False

    type
    :   Type of event

        Type:
        :   enum in [Event Type Items](bpy_types_enum_items/event_type_items.html#rna-enum-event-type-items), default `'NONE'`

    value
    :   Type:
        :   enum in [Event Value Items](bpy_types_enum_items/event_value_items.html#rna-enum-event-value-items), default `'NOTHING'`

    compare(*item*)
    :   compare

        Parameters:
        :   **item** ([`KeyMapItem`](#bpy.types.KeyMapItem "bpy.types.KeyMapItem")) – Item

        Returns:
        :   Comparison result

        Return type:
        :   boolean

    to_string(*\**, *compact=False*)
    :   to_string

        Parameters:
        :   **compact** (*boolean**,* *(**optional**)*) – Compact

        Returns:
        :   result

        Return type:
        :   string, (never None)

    *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](#bpy.types.KeyMapItem.type "bpy.types.KeyMapItem.type")