Detect Mouse status in Handler

Is it possible, within a handler function, to tell whether the mouse button is depressed? (Maybe it just had a long day, or its girlfriend left it…) I know it’s possible within modal operators.

I’m using a post-scene-update handler to automatically run a script every time after something in the scene changes.

My script deforms a mesh according to the location of an empty object, which I interactively move around with my mouse.

I would like (if possible) to perform the deformation only once I have released the mouse button.

look at these thia are all the event that blender can hand. there are also script template on the scripting window of blender.

try with this

def modal (self, context, <b>event</b>)
[INDENT]if event.type == 'LEFTMOUSE' and event.value == 'RELEASE'
[INDENT]put here your line code....


Thanks for the reply. However, as I mentioned, I’m not trying to do this in a modal operator (which I do know how to do), but rather in an arbitrary script that gets executed at an arbitrary time (in my case, a handler).