summaryrefslogtreecommitdiffstats
path: root/keyboards/planck
diff options
context:
space:
mode:
authorAdam YH Lee <adam.yh.lee@gmail.com>2017-04-12 20:58:36 -0700
committerAdam YH Lee <adam.yh.lee@gmail.com>2017-04-12 20:58:36 -0700
commit73625a603afd14ee506d1562ef5f6a199eac62ce (patch)
tree669ed65bd1962936e13aec3f62ee375fbbe09df7 /keyboards/planck
parent91b11bb4dd9a0c94fbc0feb6915acc4717357205 (diff)
parentd3301c0f8b0005738ab9aa2030d83739ffb5c4b6 (diff)
Merge branch 'master' into miuni32-OA
Diffstat (limited to 'keyboards/planck')
-rw-r--r--keyboards/planck/keymaps/khord/config.h1
-rw-r--r--keyboards/planck/keymaps/khord/keymap.c42
2 files changed, 39 insertions, 4 deletions
diff --git a/keyboards/planck/keymaps/khord/config.h b/keyboards/planck/keymaps/khord/config.h
index 008f3a5c2c..83dece50ea 100644
--- a/keyboards/planck/keymaps/khord/config.h
+++ b/keyboards/planck/keymaps/khord/config.h
@@ -48,6 +48,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* number of backlight levels */
#define BACKLIGHT_LEVELS 3
+#define BACKLIGHT_BREATHING
/* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5
diff --git a/keyboards/planck/keymaps/khord/keymap.c b/keyboards/planck/keymaps/khord/keymap.c
index 8001a0986d..e371e5b70b 100644
--- a/keyboards/planck/keymaps/khord/keymap.c
+++ b/keyboards/planck/keymaps/khord/keymap.c
@@ -37,6 +37,14 @@ enum planck_keycodes {
#define _______ KC_TRNS
#define XXXXXXX KC_NO
+#define MACRO_BREATH_TOGGLE 21
+#define MACRO_BREATH_SPEED_INC 23
+#define MACRO_BREATH_SPEED_DEC 24
+#define MACRO_BREATH_DEFAULT 25
+#define M_BRTOG M(MACRO_BREATH_TOGGLE)
+#define M_BRINC M(MACRO_BREATH_SPEED_INC)
+#define M_BRDEC M(MACRO_BREATH_SPEED_DEC)
+#define M_BRDFT M(MACRO_BREATH_DEFAULT)
// Tap Dance Declarations
enum {
ESC_CAP = 0,
@@ -173,10 +181,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = {
- {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
- {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______},
- {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
- {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, C_A_INS, C_A_DEL}
+ {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, M_BRDFT, KC_DEL },
+ {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, M_BRINC, _______},
+ {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, M_BRDEC, C_A_INS},
+ {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, M_BRTOG, C_A_DEL}
}
@@ -210,6 +218,32 @@ void persistant_default_layer_set(uint16_t default_layer) {
default_layer_set(default_layer);
}
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
+ switch(id) {
+ case MACRO_BREATH_TOGGLE:
+ if (record->event.pressed) {
+ breathing_toggle();
+ }
+ break;
+ case MACRO_BREATH_SPEED_INC:
+ if (record->event.pressed) {
+ breathing_speed_inc(1);
+ }
+ break;
+ case MACRO_BREATH_SPEED_DEC:
+ if (record->event.pressed) {
+ breathing_speed_dec(1);
+ }
+ break;
+ case MACRO_BREATH_DEFAULT:
+ if (record->event.pressed) {
+ breathing_defaults();
+ }
+ break;
+ }
+ return MACRO_NONE;
+}
+
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY: