From 1eb8523e9506c752fb726208d8853a82f06e6659 Mon Sep 17 00:00:00 2001 From: Wraul Date: Thu, 30 May 2013 20:24:39 +0200 Subject: Add support for backlight --- common/action.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'common/action.c') diff --git a/common/action.c b/common/action.c index c7c8f71f2c..b1fa0e31cf 100644 --- a/common/action.c +++ b/common/action.c @@ -20,6 +20,7 @@ along with this program. If not, see . #include "mousekey.h" #include "command.h" #include "led.h" +#include "backlight.h" #include "action_layer.h" #include "action_tapping.h" #include "action_oneshot.h" @@ -291,6 +292,26 @@ void process_action(keyrecord_t *record) case ACT_MACRO: action_macro_play(action_get_macro(record, action.func.id, action.func.opt)); break; +#endif +#ifdef BACKLIGHT_ENABLE + case ACT_BACKLIGHT: + if (!event.pressed) { + switch (action.backlight.id) { + case BACKLIGHT_INCREASE: + backlight_increase(); + break; + case BACKLIGHT_DECREASE: + backlight_decrease(); + break; + case BACKLIGHT_TOGGLE: + backlight_toggle(); + break; + case BACKLIGHT_STEP: + backlight_step(); + break; + } + } + break; #endif case ACT_COMMAND: break; -- cgit v1.2.3