diff options
author | Jack Humbert <jack.humb@gmail.com> | 2015-05-07 15:34:46 -0400 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2015-05-07 15:34:46 -0400 |
commit | cb3e499cc7dbff2607bc43cb05fc8c29a2eb9d30 (patch) | |
tree | 7d2b519d63b058bd841b311a75ea077de12f1d7f /keyboard/planck/extended_keymap_common.c | |
parent | 1e0ae2936bfacc9d8048f64719c38b6f78790bb9 (diff) |
backlight stuff
Diffstat (limited to 'keyboard/planck/extended_keymap_common.c')
-rw-r--r-- | keyboard/planck/extended_keymap_common.c | 26 |
1 files changed, 25 insertions, 1 deletions
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 <http://www.gnu.org/licenses/>. #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: |