Page MenuHome

Missing events in modal operator
Closed, InvalidPublic


System Information
Operating system: Windows 10 Enterprise (Version 1803)
Graphics card: GTX 1070

Blender Version
(2.80, 16fc62e15f0, blender2.8, 2018-12-12)

Short description of error
Blender will not send RELEASE key events to a running modal operators if an operator or dialogue is associated with the key.

Exact steps for others to reproduce the error
Starting form the Simple Modal Template script logging events shows missing events.

Pressing "Q" will generate a Event with type Q and value PRESS but releasing will not create an Event with type Q and value RELEASE.
Pressing "W" on the other hand generates both events
Pressing "G" will also only generate the initial PRESS event.

The attached .blend file contains a simple script that logs key (and mouse) events to the console to show the missing events.



Event Timeline

I think that is intended behavior. By pressing these keys you register another event handler that can decide whether to pass through events or not. It's the same when your modal operator does not return {'PASS_THROUGH'}. Modal operators "below" your operator will never see those.

@Campbell Barton (campbellbarton) should know if this really is intended behavior.

Right, modal keymap handler isn't guaranteed to get all events - other modal operators and popups can swallow the events before they reach this modal operator.