Event(bpy_struct)
=================

.. currentmodule:: bpy.types

base class --- :class:`bpy_struct`

.. class:: Event(bpy_struct)

   Window Manager Event

   .. data:: alt

      True when the Alt/Option key is held (default False, readonly)

      :type: bool

   .. data:: ascii

      Single ASCII character for this event (default "", readonly, never None)

      :type: str

   .. data:: ctrl

      True when the Ctrl key is held (default False, readonly)

      :type: bool

   .. data:: direction

      The direction (only applies to drag events) (default ``'ANY'``, readonly)

      :type: Literal[:ref:`rna_enum_event_direction_items`]

   .. data:: hyper

      True when the Hyper key is held (default False, readonly)

      :type: bool

   .. data:: is_consecutive

      Part of a trackpad or NDOF motion, interrupted by cursor motion, button or key press events (default False, readonly)

      :type: bool

   .. data:: is_mouse_absolute

      The last motion event was an absolute input (default False, readonly)

      :type: bool

   .. data:: is_repeat

      The event is generated by holding a key down (default False, readonly)

      :type: bool

   .. data:: is_tablet

      The event has tablet data (default False, readonly)

      :type: bool

   .. data:: mouse_prev_press_x

      The window relative horizontal location of the last press event (in [-inf, inf], default 0, readonly)

      :type: int

   .. data:: mouse_prev_press_y

      The window relative vertical location of the last press event (in [-inf, inf], default 0, readonly)

      :type: int

   .. data:: mouse_prev_x

      The window relative horizontal location of the mouse (in [-inf, inf], default 0, readonly)

      :type: int

   .. data:: mouse_prev_y

      The window relative vertical location of the mouse (in [-inf, inf], default 0, readonly)

      :type: int

   .. data:: mouse_region_x

      The region relative horizontal location of the mouse (in [-inf, inf], default 0, readonly)

      :type: int

   .. data:: mouse_region_y

      The region relative vertical location of the mouse (in [-inf, inf], default 0, readonly)

      :type: int

   .. data:: mouse_x

      The window relative horizontal location of the mouse (in [-inf, inf], default 0, readonly)

      :type: int

   .. data:: mouse_y

      The window relative vertical location of the mouse (in [-inf, inf], default 0, readonly)

      :type: int

   .. data:: ndof_motion

      NDOF motion event data (readonly)

      :type: :class:`NDOFMotionEventData` | None

   .. data:: oskey

      True when the Cmd key is held (default False, readonly)

      :type: bool

   .. data:: pressure

      The pressure of the tablet or 1.0 if no tablet present (in [0, 1], default 1.0, readonly)

      :type: float

   .. data:: shift

      True when the Shift key is held (default False, readonly)

      :type: bool

   .. data:: tilt

      The pressure of the tablet or zeroes if no tablet present (array of 2 items, in [-inf, inf], default (0.0, 0.0), readonly)

      :type: :class:`mathutils.Vector`

   .. data:: type

      (default ``'NONE'``, readonly)

      :type: Literal[:ref:`rna_enum_event_type_items`]

   .. data:: type_prev

      (default ``'NONE'``, readonly)

      :type: Literal[:ref:`rna_enum_event_type_items`]

   .. data:: unicode

      Single unicode character for this event (default "", readonly, never None)

      :type: str

   .. data:: value

      The type of event, only applies to some (default ``'NOTHING'``, readonly)

      :type: Literal[:ref:`rna_enum_event_value_items`]

   .. data:: value_prev

      The type of event, only applies to some (default ``'NOTHING'``, readonly)

      :type: Literal[:ref:`rna_enum_event_value_items`]

   .. data:: xr

      XR event data (readonly)

      :type: :class:`XrEventData` | None

   .. classmethod:: bl_rna_get_subclass(id, default=None, /)
   
      :param id: The RNA type identifier.
      :type id: str
      :param default: The value to return when not found.
      :type default: :class:`bpy.types.Struct` | None
      :return: The RNA type or default when not found.
      :rtype: :class:`bpy.types.Struct`


   .. classmethod:: bl_rna_get_subclass_py(id, default=None, /)
   
      :param id: The RNA type identifier.
      :type id: str
      :param default: The value to return when not found.
      :type default: type | None
      :return: The class or default when not found.
      :rtype: type


Inherited Properties
--------------------

.. hlist::
   :columns: 2

   - :class:`bpy_struct.id_data`

Inherited Functions
-------------------

.. hlist::
   :columns: 2

   - :class:`bpy_struct.as_pointer`
   - :class:`bpy_struct.driver_add`
   - :class:`bpy_struct.driver_remove`
   - :class:`bpy_struct.get`
   - :class:`bpy_struct.id_properties_clear`
   - :class:`bpy_struct.id_properties_ensure`
   - :class:`bpy_struct.id_properties_ui`
   - :class:`bpy_struct.is_property_hidden`
   - :class:`bpy_struct.is_property_overridable_library`
   - :class:`bpy_struct.is_property_readonly`
   - :class:`bpy_struct.is_property_set`
   - :class:`bpy_struct.items`
   - :class:`bpy_struct.keyframe_delete`
   - :class:`bpy_struct.keyframe_insert`
   - :class:`bpy_struct.keys`
   - :class:`bpy_struct.path_from_id`
   - :class:`bpy_struct.path_from_module`
   - :class:`bpy_struct.path_resolve`
   - :class:`bpy_struct.pop`
   - :class:`bpy_struct.property_overridable_library_set`
   - :class:`bpy_struct.property_unset`
   - :class:`bpy_struct.rna_ancestors`
   - :class:`bpy_struct.type_recast`
   - :class:`bpy_struct.values`

References
----------

.. hlist::
   :columns: 2

   - :class:`Gizmo.invoke`
   - :class:`Gizmo.modal`
   - :class:`KeyMapItems.match_event`
   - :class:`Operator.invoke`
   - :class:`Operator.modal`
   - :class:`Window.event_simulate`
   - :class:`WindowManager.invoke_confirm`
   - :class:`WindowManager.invoke_props_popup`
   - :class:`WindowManager.piemenu_begin__internal`

