From cb3e499cc7dbff2607bc43cb05fc8c29a2eb9d30 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 7 May 2015 15:34:46 -0400 Subject: backlight stuff --- keyboard/planck/extended_keymap_common.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'keyboard/planck/extended_keymap_common.c') diff --git a/keyboard/planck/extended_keymap_common.c b/keyboard/planck/extended_keymap_common.c index f8fc3209fb..841b249431 100644 --- a/keyboard/planck/extended_keymap_common.c +++ b/keyboard/planck/extended_keymap_common.c @@ -22,6 +22,7 @@ along with this program. If not, see . #include "action.h" #include "action_macro.h" #include "debug.h" +#include "backlight.h" static action_t keycode_to_action(uint16_t keycode); @@ -46,7 +47,30 @@ action_t action_for_key(uint8_t layer, keypos_t key) action_t action; action.code = ACTION_MACRO(keycode & 0xFF); return action; - } + } else if (keycode >= BL_0 & keycode <= BL_15) { + action_t action; + action.code = ACTION_BACKLIGHT_LEVEL(keycode & 0x000F); + return action; + } else if (keycode == BL_DEC) { + action_t action; + action.code = ACTION_BACKLIGHT_DECREASE(); + return action; + } else if (keycode == BL_INC) { + action_t action; + action.code = ACTION_BACKLIGHT_INCREASE(); + return action; + } else if (keycode == BL_TOGG) { + action_t action; + action.code = ACTION_BACKLIGHT_TOGGLE(); + return action; + } else if (keycode == BL_STEP) { + action_t action; + action.code = ACTION_BACKLIGHT_STEP(); + return action; + } else if (keycode == RESET) { + bootloader_jump(); + return; + } switch (keycode) { case KC_FN0 ... KC_FN31: -- cgit v1.2.3