Просмотр исходного кода

Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware

cbbrowne 9 лет назад
Родитель
Сommit
c21a882ec9

+ 1 - 1
doc/TMK_README.md

@@ -113,7 +113,7 @@ Third party libraries like LUFA, PJRC and V-USB have their own license respectiv
 
 Build Firmware and Program Controller
 -------------------------------------
-See [doc/build.md](tmk_core/doc/build.md), or the readme in the particular keyboards/* folder.
+See [build environment setup](/readme.md#build-environment-setup), or the readme in the particular keyboards/* folder.
 
 
 

+ 1 - 1
doc/keycode.txt

@@ -2,7 +2,7 @@ Keycode Symbol Table
 ====================
 Keycodes are defined in `common/keycode.h`.
 Range of 00-A4 and E0-E7 are identical with HID Usage:
-<http://www.usb.org/developers/devclass_docs/Hut1_11.pdf>
+<http://www.usb.org/developers/hidpage/Hut1_12v2.pdf>
 Virtual keycodes are defined out of above range to support special actions.
 
 

+ 27 - 0
keyboards/preonic/keymaps/kinesis/Makefile

@@ -0,0 +1,27 @@
+
+
+# Build Options
+#   change to "no" to disable the options, or define them in the Makefile in 
+#   the appropriate keymap folder that will get included automatically
+#
+BOOTMAGIC_ENABLE = no       # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE = yes       # Mouse keys(+4700)
+EXTRAKEY_ENABLE = yes       # Audio control and System control(+450)
+CONSOLE_ENABLE = no         # Console for debug(+400)
+COMMAND_ENABLE = yes        # Commands for debug and configuration
+NKRO_ENABLE = yes           # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+BACKLIGHT_ENABLE = yes      # Enable keyboard backlight functionality
+MIDI_ENABLE = no            # MIDI controls
+AUDIO_ENABLE = yes          # Audio output on port C6
+UNICODE_ENABLE = no         # Unicode
+BLUETOOTH_ENABLE = no       # Enable Bluetooth with the Adafruit EZ-Key HID
+RGBLIGHT_ENABLE = no        # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
+
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE = no    # Breathing sleep LED during USB suspend
+
+TAP_DANCE_ENABLE = yes
+
+ifndef QUANTUM_DIR
+	include ../../../../Makefile
+endif

+ 92 - 0
keyboards/preonic/keymaps/kinesis/config.h

@@ -0,0 +1,92 @@
+/*
+Copyright 2012 Jun Wako <wakojun@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID       0xFEED
+#define PRODUCT_ID      0x6061
+#define DEVICE_VER      0x0001
+#define MANUFACTURER    Ortholinear Keyboards
+#define PRODUCT         The Preonic Keyboard
+#define DESCRIPTION     A compact ortholinear keyboard
+
+/* key matrix size */
+#define MATRIX_ROWS 5
+#define MATRIX_COLS 12
+
+/* Planck PCB default pin-out */
+#define MATRIX_ROW_PINS { D2, D5, B5, B6, D3 }
+#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
+#define UNUSED_PINS
+
+#define BACKLIGHT_PIN B7
+
+/* COL2ROW or ROW2COL */
+#define DIODE_DIRECTION COL2ROW
+
+/* define if matrix has ghost */
+//#define MATRIX_HAS_GHOST
+
+/* number of backlight levels */
+#define BACKLIGHT_LEVELS 3
+
+/* Set 0 if debouncing isn't needed */
+#define DEBOUNCING_DELAY 5
+
+/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
+#define LOCKING_SUPPORT_ENABLE
+/* Locking resynchronize hack */
+#define LOCKING_RESYNC_ENABLE
+
+/* key combination for command */
+#define IS_COMMAND() ( \
+    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
+)
+
+/* ws2812 RGB LED */
+#define RGB_DI_PIN D1
+#define RGBLIGHT_TIMER
+#define RGBLED_NUM 28     // Number of LEDs
+#define RGBLIGHT_HUE_STEP 10
+#define RGBLIGHT_SAT_STEP 17
+#define RGBLIGHT_VAL_STEP 17
+
+/*
+ * Feature disable options
+ *  These options are also useful to firmware size reduction.
+ */
+
+#define TAPPING_TERM 200
+
+/* disable debug print */
+// #define NO_DEBUG
+
+/* disable print */
+// #define NO_PRINT
+
+/* disable action features */
+//#define NO_ACTION_LAYER
+//#define NO_ACTION_TAPPING
+//#define NO_ACTION_ONESHOT
+//#define NO_ACTION_MACRO
+//#define NO_ACTION_FUNCTION
+
+#endif

+ 144 - 0
keyboards/preonic/keymaps/kinesis/keymap.c

@@ -0,0 +1,144 @@
+#include "preonic.h"
+#include "action_layer.h"
+#include "eeconfig.h"
+#ifdef AUDIO_ENABLE
+#include "audio.h"
+#endif
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+#define _QWERTY 0
+#define _FN 1
+#define _ULCK 2
+
+// Fillers to make layering more clear
+#define _______ KC_TRNS
+#define XXXXXXX KC_NO
+#define HYP_TIC ALL_T(KC_GRV)
+#define EQ_LOCK TD(TD_EQ_LOCK)
+#define MIN_ULK TD(TD_MIN_ULOCK)
+
+//Tap Dance Declarations
+enum {
+  TD_EQ_LOCK = 0,
+  TD_MIN_ULOCK
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+  /* Qwerty
+   * ,-----------------------------------------------------------------------------------.
+   * |   =  |   1  |   2  |   3  |   4  |   5  |   6  |   7  |   8  |   9  |   0  |  -   |
+   * |------+------+------+------+------+------+------+------+------+------+------+------|
+   * | Tab  |   Q  |   W  |   E  |   R  |   T  |   Y  |   U  |   I  |   O  |   P  |  \   |
+   * |------+------+------+------+------+-------------+------+------+------+------+------|
+   * | Ctrl |   A  |   S  |   D  |   F  |   G  |   H  |   J  |   K  |   L  |   ;  |  "   |
+   * |------+------+------+------+------+------|------+------+------+------+------+------|
+   * | Shift|   Z  |   X  |   C  |   V  |   B  |   N  |   M  |   ,  |   .  |   /  |Shift |
+   * |------+------+------+------+------+------+------+------+------+------+------+------|
+   * |  FN  |   `  | Alt  | LGUI | Back | ESC  |ENTER | SPCE | RGUI |   [  |  ]   |  FN  |
+   * `-----------------------------------------------------------------------------------'
+   */
+  [_QWERTY] = {
+    {EQ_LOCK, KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    MIN_ULK },
+    {KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_BSLS },
+    {KC_LCTL, KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT },
+    {KC_LSPO, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_RSPC },
+    {MO(_FN), HYP_TIC, KC_LALT, KC_LGUI, KC_BSPC, KC_ESC,  KC_ENT,  KC_SPC,  KC_RGUI, KC_LBRC, KC_RBRC, MO(_FN) }
+  },
+
+  /* Fn
+   * ,-----------------------------------------------------------------------------------.
+   * |      |  F1  |  F2  |  F3  |  F4  |  F5  |  F6  |  F7  |  F8  |  F9  |  F10 |      |
+   * |------+------+------+------+------+-------------+------+------+------+------+------|
+   * |      |  F11 |  F12 |  F13 |  F14 |  F15 |  F16 |  F17 |  F18 |  F19 |  F20 |      |
+   * |------+------+------+------+------+-------------+------+------+------+------+------|
+   * |      | VOL- | VOL+ | MUTE |BLtogg|      | LEFT | DOWN |  UP  | RGHT |      |      |
+   * |------+------+------+------+------+------|------+------+------+------+------+------|
+   * |      | BL-  | BL+  |Aud on|AudOff|AGnorm|AGswap|      |      |      |      |      |
+   * |------+------+------+------+------+------|------+------+------+------+------+------|
+   * |      |Voice-|Voice+|Mus on|MusOff|      |      |PLY/PS|      | PREV | NEXT |      |
+   * `-----------------------------------------------------------------------------------'
+   */
+  [_FN] = {
+    {_______, KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  _______ },
+    {_______, KC_F11,  KC_F12,  KC_F13,  KC_F14,  KC_F15,  KC_F16,  KC_F17,  KC_F18,  KC_F19,  KC_F20,  _______ },
+    {_______, KC_VOLD, KC_VOLU, KC_MUTE, BL_TOGG, _______, KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT, _______, _______ },
+    {_______, BL_DEC,  BL_INC,  AU_ON,   AU_OFF,  AG_NORM, AG_SWAP, _______, _______, _______, _______, _______ },
+    {_______, MUV_DE,  MUV_IN,  MU_ON,   MU_OFF,  _______, _______, KC_MPLY, _______, KC_MPRV, KC_MNXT, _______ }
+  }
+
+};
+
+float tone_startup[][2] = {
+  {NOTE_B5, 20},
+  {NOTE_B6, 8},
+  {NOTE_DS6, 20},
+  {NOTE_B6, 8}
+};
+
+float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
+float music_scale[][2]  = SONG(MUSIC_SCALE_SOUND);
+
+void persistant_default_layer_set(uint16_t default_layer) {
+  eeconfig_update_default_layer(default_layer);
+  default_layer_set(default_layer);
+}
+
+/*bool process_record_user(uint16_t keycode, keyrecord_t *record) {*/
+  /*return true;*/
+  /*[>switch (keycode) {<]*/
+    /*[>case QWERTY:<]*/
+      /*[>return true;<]*/
+  /*[>}<]*/
+/*};*/
+
+void matrix_init_user(void) {
+  startup_user();
+}
+
+void startup_user()
+{
+  _delay_ms(20); // gets rid of tick
+  PLAY_NOTE_ARRAY(tone_startup, false, 0);
+}
+
+void shutdown_user()
+{
+  PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
+  _delay_ms(150);
+  stop_all_notes();
+}
+
+void music_on_user(void)
+{
+  music_scale_user();
+}
+
+void music_scale_user(void)
+{
+  PLAY_NOTE_ARRAY(music_scale, false, 0);
+}
+
+
+const qk_tap_dance_action_t tap_dance_actions[] = {
+  //Tap once for equal, twice for hyper + X (alfred lock)
+  [TD_EQ_LOCK] = ACTION_TAP_DANCE_DOUBLE(KC_EQL,  HYPR(KC_X)),
+  //Tap once for minus, twice for time.heals.nothing
+  [TD_MIN_ULOCK] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, M(_ULCK))
+};
+
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+{
+  switch(id) {
+    case _ULCK:
+      if (record->event.pressed) {
+        /* time.heals.nothing */
+        return MACRO( I(220), T(T), T(I), T(M), T(E), T(DOT), T(H), T(E), T(A), T(L), T(S), T(DOT), T(N), T(O), T(T), T(H), T(I), T(N), T(G), END);
+      }
+      break;
+  }
+  return MACRO_NONE;
+};

+ 1 - 0
keyboards/preonic/keymaps/kinesis/readme.md

@@ -0,0 +1 @@
+# The default Preonic layout - largely based on the Planck's

+ 20 - 0
keyboards/satan/keymaps/denolfe/Makefile

@@ -0,0 +1,20 @@
+
+# Build Options
+#   comment out to disable the options.
+#
+BOOTMAGIC_ENABLE ?= yes	# Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE ?= no	# Mouse keys(+4700)
+EXTRAKEY_ENABLE ?= yes	# Audio control and System control(+450)
+CONSOLE_ENABLE ?= yes	# Console for debug(+400)
+COMMAND_ENABLE ?= yes    # Commands for debug and configuration
+NKRO_ENABLE ?= yes		# USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+RGBLIGHT_ENABLE ?= no   # Enable keyboard underlight functionality (+4870)
+BACKLIGHT_ENABLE ?= yes  # Enable keyboard backlight functionality (+1150)
+MIDI_ENABLE ?= no 		# MIDI controls
+AUDIO_ENABLE ?= no
+UNICODE_ENABLE ?= no 		# Unicode
+BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
+
+ifndef QUANTUM_DIR
+	include ../../../../Makefile
+endif

+ 12 - 0
keyboards/satan/keymaps/denolfe/README.md

@@ -0,0 +1,12 @@
+# denolfe's Layout
+Customized Satan keymap 
+
+![Layout](keyboard-layout.png "Practical Keymap")
+
+## Programming Instructions:
+`cd` into keymap directory, `make dfu`
+
+## Features
+- Movement keys with <kbd>CapsLock</kbd> + <kbd>h</kbd>, <kbd>j</kbd>, <kbd>k</kbd>, <kbd>l</kbd>
+- Media Keys
+- Backlight control

BIN
keyboards/satan/keymaps/denolfe/keyboard-layout.png


+ 171 - 0
keyboards/satan/keymaps/denolfe/keymap.c

@@ -0,0 +1,171 @@
+#include "satan.h"
+
+#ifdef RGBLIGHT_ENABLE
+#include "rgblight.h"
+#endif
+
+// Used for SHIFT_ESC
+#define MODS_CTRL_MASK  (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+#define _BL 0
+#define _FL 1
+#define _SL 2
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+  /* Keymap _BL: (Base Layer) Default Layer
+   * ,-----------------------------------------------------------.
+   * |Esc~| 1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backsp |
+   * |-----------------------------------------------------------|
+   * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  \  |
+   * |-----------------------------------------------------------|
+   * |CAPS   |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return |
+   * |-----------------------------------------------------------|
+   * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift     |
+   * |-----------------------------------------------------------|
+   * |Ctrl|Gui |Alt |      Space            |Alt |Gui |FN  |Ctrl |
+   * `-----------------------------------------------------------'
+   */
+[_BL] = KEYMAP(
+  F(0),      KC_1,   KC_2,   KC_3,   KC_4,   KC_5,   KC_6,   KC_7,   KC_8,     KC_9,    KC_0,    KC_MINS,  KC_EQL,   KC_BSPC, \
+  KC_TAB,    KC_Q,   KC_W,   KC_E,   KC_R,   KC_T,   KC_Y,   KC_U,   KC_I,     KC_O,    KC_P,    KC_LBRC,  KC_RBRC,  KC_BSLS, \
+  MO(_FL),   KC_A,   KC_S,   KC_D,   KC_F,   KC_G,   KC_H,   KC_J,   KC_K,     KC_L,    KC_SCLN, KC_QUOT,            KC_ENT,  \
+  KC_LSFT,   KC_Z,   KC_X,   KC_C,   KC_V,   KC_B,   KC_N,   KC_M,   KC_COMM,  KC_DOT,  KC_SLSH,                     KC_RSFT, \
+  KC_LCTL, KC_LGUI,KC_LALT,                          KC_SPC,                            KC_RALT, MO(_FL),  KC_RGUI,  KC_RCTL),
+
+  /* Keymap _FL: Function Layer
+   * ,-----------------------------------------------------------.
+   * |   |   |   |   |   |   |   |   |   |   |   |   |   |  RESET|
+   * |-----------------------------------------------------------|
+   * |     |   |   |   |   |   |   |   |   |   |   |BL-|BL+|BL   |
+   * |-----------------------------------------------------------|
+   * |      |   |   |   |   |   |   |       |   |   |   |        |
+   * |-----------------------------------------------------------|
+   * |        | F1|F2 | F3|F4 | F5| F6| F7| F8|   |   |          |
+   * |-----------------------------------------------------------|
+   * |    |    |    |                        |    |    |    |    |
+   * `-----------------------------------------------------------'
+   */
+[_FL] = KEYMAP(
+  #ifdef RGBLIGHT_ENABLE
+  KC_GRV, KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET,  \
+  KC_TRNS,KC_TRNS,KC_TRNS,  KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,   KC_TRNS,   BL_DEC,   BL_INC,   BL_TOGG, \
+  KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,    KC_TRNS,              KC_TRNS, \
+  KC_TRNS, F(1), F(2), F(3), F(4), F(5), F(6), F(7), F(8), KC_TRNS, KC_TRNS, KC_TRNS, \
+  KC_TRNS,KC_TRNS,KC_TRNS,          KC_TRNS,                               KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
+  #else
+  KC_GRV,   KC_F1,    KC_F2,    KC_F3,     KC_F4,    KC_F5,    KC_F6,    KC_F7,          KC_F8,        KC_F9,          KC_F10,   KC_F11,  KC_F12,     KC_DEL,   \
+  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,   KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_PGDN,        KC_PGUP,      KC_TRNS,        KC_END,   KC_MPRV, KC_MNXT,    KC_MPLY, \
+  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,   KC_TRNS,  KC_TRNS,  KC_LEFT,  KC_DOWN,        KC_UP,        KC_RIGHT,       KC_TRNS,           KC_TRNS,    KC_TRNS, \
+  KC_TRNS,  KC_TRNS,  KC_TRNS,  BL_DEC,    BL_TOGG,  BL_INC,   KC_HOME,  LCTL(KC_LEFT),  LCTL(KC_END), LCTL(KC_RIGHT), KC_TRNS,                       RESET, \
+  KC_TRNS,  KC_TRNS,  F(9),          KC_TRNS,                                                          KC_TRNS,        KC_TRNS,           KC_TRNS,    KC_TRNS),
+  #endif
+
+[_SL] = KEYMAP(
+  KC_GRV,   KC_F1,    KC_F2,    KC_F3,     KC_F4,    KC_F5,    KC_F6,    KC_F7,    KC_F8,    KC_F9,     KC_F10,   KC_F11,    KC_F12,  KC_DEL,   \
+  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,   KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_PGDN,  KC_PGUP,  KC_TRNS,   LSFT(KC_END),   KC_MPRV,     KC_MNXT,    KC_MPLY, \
+  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,   KC_TRNS,  KC_TRNS,  LSFT(KC_LEFT),  LSFT(KC_DOWN),  LSFT(KC_UP),    LSFT(KC_RIGHT),  KC_TRNS,  KC_TRNS,  KC_TRNS, \
+  KC_TRNS,  KC_TRNS,  KC_TRNS,  BL_DEC,    BL_TOGG,  BL_INC,  LSFT(KC_HOME),  LCTL(LSFT(KC_LEFT)),  LCTL(LSFT(KC_END)), LCTL(LSFT(KC_RIGHT)),   KC_TRNS,                        RESET, \
+  KC_TRNS,  KC_TRNS,  KC_TRNS,             KC_TRNS,                               KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
+};
+
+enum function_id {
+    SHIFT_ESC,
+    #ifdef RGBLIGHT_ENABLE
+    RGBLED_TOGGLE,
+    RGBLED_STEP_MODE,
+    RGBLED_INCREASE_HUE,
+    RGBLED_DECREASE_HUE,
+    RGBLED_INCREASE_SAT,
+    RGBLED_DECREASE_SAT,
+    RGBLED_INCREASE_VAL,
+    RGBLED_DECREASE_VAL
+    #endif
+};
+
+const uint16_t PROGMEM fn_actions[] = {
+  [0]  = ACTION_FUNCTION(SHIFT_ESC),
+  #ifdef RGBLIGHT_ENABLE
+  [1]  = ACTION_FUNCTION(RGBLED_TOGGLE),
+  [2]  = ACTION_FUNCTION(RGBLED_STEP_MODE),
+  [3]  = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
+  [4]  = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
+  [5]  = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
+  [6]  = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
+  [7]  = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
+  [8]  = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
+  #endif
+  [9]  = ACTION_LAYER_MODS(2, MOD_LSFT)
+};
+
+void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
+  static uint8_t shift_esc_shift_mask;
+  switch (id) {
+    case SHIFT_ESC:
+      shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
+      if (record->event.pressed) {
+        if (shift_esc_shift_mask) {
+          add_key(KC_GRV);
+          send_keyboard_report();
+        } else {
+          add_key(KC_ESC);
+          send_keyboard_report();
+        }
+      } else {
+        if (shift_esc_shift_mask) {
+          del_key(KC_GRV);
+          send_keyboard_report();
+        } else {
+          del_key(KC_ESC);
+          send_keyboard_report();
+        }
+      }
+      break;
+    //led operations
+    #ifdef RGBLIGHT_ENABLE
+    case RGBLED_TOGGLE:
+      if (record->event.pressed) {
+        rgblight_toggle();
+      }
+      break;
+    case RGBLED_INCREASE_HUE:
+      if (record->event.pressed) {
+        rgblight_increase_hue();
+      }
+      break;
+    case RGBLED_DECREASE_HUE:
+      if (record->event.pressed) {
+        rgblight_decrease_hue();
+      }
+      break;
+    case RGBLED_INCREASE_SAT:
+      if (record->event.pressed) {
+        rgblight_increase_sat();
+      }
+      break;
+    case RGBLED_DECREASE_SAT:
+      if (record->event.pressed) {
+        rgblight_decrease_sat();
+      }
+      break;
+    case RGBLED_INCREASE_VAL:
+      if (record->event.pressed) {
+        rgblight_increase_val();
+      }
+      break;
+    case RGBLED_DECREASE_VAL:
+      if (record->event.pressed) {
+        rgblight_decrease_val();
+      }
+      break;
+    case RGBLED_STEP_MODE:
+      if (record->event.pressed) {
+        rgblight_step();
+      }
+      break;
+    #endif
+  }
+}