From 9472ba1d39e85b11c28d16b793fac1150ba153e5 Mon Sep 17 00:00:00 2001 From: Matt Mower Date: Wed, 20 Jan 2016 18:12:47 -0600 Subject: gui: Actions: Toggle backlight on power key Create GUIAction to handle KEY_POWER with a screen backlight toggle. Change-Id: Iad0a7923b4a776e0336722db74d6fc46cd0107a2 --- gui/action.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gui/action.cpp') diff --git a/gui/action.cpp b/gui/action.cpp index 7d34da8a0..ef110bcfd 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -198,6 +198,7 @@ GUIAction::GUIAction(xml_node<>* node) ADD_ACTION(mountsystemtoggle); ADD_ACTION(setlanguage); ADD_ACTION(checkforapp); + ADD_ACTION(togglebacklight); // remember actions that run in the caller thread for (mapFunc::const_iterator it = mf.begin(); it != mf.end(); ++it) @@ -1865,6 +1866,12 @@ int GUIAction::setlanguage(std::string arg __unused) return 0; } +int GUIAction::togglebacklight(std::string arg __unused) +{ + blankTimer.toggleBlank(); + return 0; +} + int GUIAction::setbootslot(std::string arg) { operation_start("Set Boot Slot"); -- cgit v1.2.3