How to receive BacklightTurnedOff event
Posted: Thu Feb 04, 2016 5:06 pm
Hello,
I am using a Qterm A12 panel in an outdoor environment.
When the internal temperature rises above a threshold, I want to programmatically enable the screensaver, so that the backlight will turn off after 3 minutes of non-activity. This code does that, so far, so good:
// Set backlight timeout to 180 seconds
Core.Api.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IBacklightService>().SetBacklightTimout(180);
// Set backlight to automatically turn off Core.Api.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IBacklightService>().SetAutomaticallyTurnOfBacklight(true);
Then, when the internal temperature drops below another threshold, I want to programmatically turn the backlight back on and disable the screen saver. This code does that, so far, so good:
// Turn on backilight.
Core.Api.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IBacklightService>().TurnBacklightOn();
// Turn off screen saver
Core.Api.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IBacklightService>().SetAutomaticallyTurnOfBacklight(false);
The problem I have is that when the screen is dark and the user touches it, if the user presses an area of the screen that has a button, the button action will be performed. Which was not intended, or a good thing.
To me, the soultion would be to subscribe to the public BacklightTurnedOff event, and handle accordingly, but my event handler never fires:
// Subscribe to event
Core.Api.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IBacklightService>().BacklightTurnedOff += new EventHandler(BacklightOffEvent);
// Event handler.... this never fires
void BacklightOffEvent (object sender, EventArgs myEventArgs)
{
// Go to a blank or buttonless screen, that when pressed, returns to the
// previous screen (which was the active screen when the backlight turned off).
Globals.Logo_Screen.Show();
}
How can I receive the BacklightTurnedOff event? Or how, in some other way, achieve my goal that no accidental button actions be performed?
Thanks
I am using a Qterm A12 panel in an outdoor environment.
When the internal temperature rises above a threshold, I want to programmatically enable the screensaver, so that the backlight will turn off after 3 minutes of non-activity. This code does that, so far, so good:
// Set backlight timeout to 180 seconds
Core.Api.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IBacklightService>().SetBacklightTimout(180);
// Set backlight to automatically turn off Core.Api.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IBacklightService>().SetAutomaticallyTurnOfBacklight(true);
Then, when the internal temperature drops below another threshold, I want to programmatically turn the backlight back on and disable the screen saver. This code does that, so far, so good:
// Turn on backilight.
Core.Api.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IBacklightService>().TurnBacklightOn();
// Turn off screen saver
Core.Api.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IBacklightService>().SetAutomaticallyTurnOfBacklight(false);
The problem I have is that when the screen is dark and the user touches it, if the user presses an area of the screen that has a button, the button action will be performed. Which was not intended, or a good thing.
To me, the soultion would be to subscribe to the public BacklightTurnedOff event, and handle accordingly, but my event handler never fires:
// Subscribe to event
Core.Api.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IBacklightService>().BacklightTurnedOff += new EventHandler(BacklightOffEvent);
// Event handler.... this never fires
void BacklightOffEvent (object sender, EventArgs myEventArgs)
{
// Go to a blank or buttonless screen, that when pressed, returns to the
// previous screen (which was the active screen when the backlight turned off).
Globals.Logo_Screen.Show();
}
How can I receive the BacklightTurnedOff event? Or how, in some other way, achieve my goal that no accidental button actions be performed?
Thanks