Check whether keyboard backlight is on
Article Metadata
Tested with
Devices(s): N78
Compatibility
Platform(s): S60 3rd,3rd FP1,3rd Fp2
Platform Security
Capabilities: )
Article
Keywords: keywords=HAL::Get(),User::ResetInactivityTime()
Created: lming
(21 Nov 2008)
Last edited: hamishwillee
(08 Feb 2012)
Overview
This snippet demonstrates how to check whether the keyboard backlight is off and how to turn it on. This snippet can be self-signed.
Source file
//necessary library
LIBRARY HAL.LIB
LIBRARY euser.lib
//necessary header file
#include <HAL.h>
#include <hal_data.h>
#include <e32std.h>
TBool keyboardBacklightState;
//retrieve EKeyboardBacklightStatevalue
HAL::Get( HALData::EKeyboardBacklightState, keyboardBacklightState);
if(keyboardBacklightState)
{
//keyboard backlight is ON now.
.......
}
else
{
//keyboard backlight is Off now.
//ResetInactivityTime will reset all user inactivity timers and backlight
//will be turn on
User::ResetInactivityTime()
}
Postconditions
The keyboard backlight will be turned on. Notice that User::ResetInactivityTime also makes the screen backlight to be turned on.

