How to capture leftmouse up event by python? After seeing bpy.types.Event https://docs.blender.org/api/current/bpy.types.Event.html, and some code examples, I cannot find the event of leftmouse up, only LEFTMOUSE is available. (correct me if it is wrong)

I want to ask how to capture the leftmouse up event using python. Thanks.
As mentioned in the document, the Event.type will tell you which key or mouse button sent the event and the Event.value specifies if pressing or releasing happened.

So you can do something like below in the modal method of an operator for example:

Here ctx is the current context in Blender and the evt is bpy.types.Event instance

def modal(self, ctx, evt):
    if evt.type == 'LEFTMOUSE':
        if evt.value == 'PRESS':
            print('LMB Pressed')
        elif evt.value == 'RELEASE':
            print('LMB Released')
    return {'RUNNING_MODAL'}


A thorough example of using modal event handler is at the link below.

https://developer.blender.org/diffusion/B/browse/master/release/scripts/templates_py/operator_modal.py