Register to global events from module?

Is it possible for modules to hook up on events on a “global” level? I want my module to get notified when a specific event occurs, maybe mouse click or some hotkey, even when the module has no focus.
I looked through the code (app::Scene -> app::RackScrollWidget -> app::RackWidget and event::State) and it seems to me that this is not possible?

This doesn’t make sense. When you click a module, it gains focus. Define “global level”.

I want my module to get notified of a mouse press and mouse release event on a parameter of any module other than my own module. It would be some sort of “touch” behaviour for the parameter. I know about APP->scene->rack->touchedParam but I don’t see a how to check when the parameter is released.
Alternatively I would be fine with some hotkey: When CTRL+F2 or something is pressed anywhere in the rack my module receives that event.

No, that is not possible.

Ok, that is what I expected after looking at Rack‘s code. Thanks anyway!
I‘ll create a feature request at some time.

Actually, I found a way that satisfies my purpose :grinning:
APP->event->draggedWidget becomes NULL when the mouse button is released after a parameter change.

I believe that should work. I’ve just added get*() methods to event::State, which is now a stable method of getting those member variables.

1 Like

Thanks for that! So I can remove this comment… :wink:

Anmerkung%202019-06-14%20213629