Event

IN the API Documentation bpy.types.Event has a bunch of attributes which seem to be missing in Blender. For example the documentation lists “mouse_x” as an attribute of Event (bpy.types.Event) but if I try to access this attribute in blender using bpy.types.Event().mouse_x it throws me some error.

What’s going on here?

I’m new to scripting so this is probably a stupid question, but if anyone could clarify this it would be helpful.

bpy.types.Event().mouse_x is trying to access the event_x attribute on the Event class, not on an instance of the class.

Yes, that makes sense. Thanks

See the Operator Modal View3D template in Blender’s Text Editor for an example