Is it possible to have a universal / global event fire on each mouse click, even if the actual program is minimized, or the click isn't on a window that is part of the application?
Here is code I have tried so far :
// Initialize Global Pre-Process Input
InputManager.Current.PreProcessInput += Current_PreProcessInput;
private void Current_PreProcessInput(object sender, PreProcessInputEventArgs e)
{
if (e.StagingItem.Input is MouseButtonEventArgs)
{
GlobalClickEventHandler(sender, (MouseButtonEventArgs)e.StagingItem.Input);
}
}
private void GlobalClickEventHandler(object sender, MouseButtonEventArgs input)
{
if (input.LeftButton == MouseButtonState.Released)
{
}
}
Problem here is; this only works when a click is in a window part of the application. Is there some alternative way to have an event fire even if the application is minimized or the click is outside any application window?
Any help or advice will be appreciated.