2
$\begingroup$

In a modal operator's modal() definition, the code below:

if event.type == 'MOUSEMOVE':
print ("MOUSEMOVE")

will fire off and print the result whenever the mouse moves. But this code:

if event.type == 'EVT_TWEAK_L':
print ("EVENT_TWEAK")

is never triggered whether I'm moving the mouse while the LMB is pressed down or not.

What is required to get a modal operator to receive a tweak event?

$\endgroup$
1
$\begingroup$

I was able to get 'EVT_TWEAK_L' to print the message from within the operator by changing the keymap.

I changed the way the operator was called in the keymap from:

Mouse> Any Left Mouse

to

Tweak> Left> Any

I assumed that since a modal operator called by a LMB click could also catch a bunch of other events such as 'RIGHTMOUSE', 'MOUSEMOVE', 'ESC', alt, ctrl, etc etc, that it would also be able to catch tweak events, but that doesn't seem to be the case.

I'll update the answer if I find another way to do it.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.