How to receive ALL mouse/touch/keyboard events in one place?

Hi,

I have a Slate-heavy C++ app, and I’ve implemented a dynamic frame-rate system that throttles the framerate when the app isn’t interacted with. This depends on every major Slate class resetting the throttle timer, and it’s getting tedious.

Is there a way to centrally listen in on all mouse/touch/keyboard events for the sole purpose of resetting this throttling timer? I don’t want to tamper with the events, I only want to know that they happened in a central place, rather than hooking into a thousand places in the Slate controls.

Thanks!

Per

I managed to solve it, and I’m posting the solution here for posterity.

The solution is to use a Slate custom input pre-processor, which gets first dibs on all events, with the ability to modify them as well.

Our use case is simply to detect presence for the benefit of a dynamic frame rate system that throttles the frame rate and battery usage when the app isn’t directly being interacted with.

I made a Gist: Unreal Engine example of intercepting Slate input events at the earliest possible time. In this case, the purpose is to detect activity in the app, in order to drive a dynamic framerate system. · GitHub

It hasn’t been tested with touch events, but since the pre-processor is handling pointer events, I’d assume that it naturally does.

Per