Blur and focus events for UXP host application

Hi,

I’m looking at handling application-wide “blue” and “focus” events for the entire UXP host application (Photoshop in the case at hand).

The scenario is where the user has some other application with input focus (say, a web browser) and then clicks back into Photoshop: at this point we need to get a notification in the UXP plugin.

For the “blur” event, the scenario is the inverse, obviously enough: here the user is in Photoshop and shifts input focus away from the application by clicking on the web browser window.

check this link, it may be what you looking for. one of the event it register focus change.
https://forums.creativeclouddeveloper.com/t/how-can-i-use-app-eventnotifier/4801/2?u

Thank you, Wanokuni.

We did look at require(“photoshop”).eventNotifier() but the host never calls back when the application is activated or deactivated. We only get internal events like when the user selects a different tool.