Page 1 of 1

How to receive BacklightTurnedOff event

Posted: Thu Feb 04, 2016 5:06 pm
by MarkTX
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

Re: How to receive BacklightTurnedOff event

Posted: Wed Jan 29, 2020 3:41 pm
by Russ C.
We tested the code you posted, and it appears to work in iX 2.40 SP4, it will trigger the <Screen>.Show(); event

Re: How to receive BacklightTurnedOff event

Posted: Thu Jun 04, 2020 4:20 pm
by MarkTX
We have several X2E-12HPs in our lab and are able to verify that the BacklightTurnedOff event does indeed now work as expected. Even better, our tests revealed that the touch screen now exhibits what I would call the correct behavior - onscreen buttons no longer generate click events if the screen is touched to reactivate the back light. The BacklightTurnedOff event is no longer needed for this case! Very nice all the same. Thanks for your reply.