summaryrefslogtreecommitdiff
path: root/keyboards/planck
diff options
context:
space:
mode:
authorDylan Khor <khord@simspace.com>2017-04-09 02:02:40 -0400
committerDylan Khor <khord@simspace.com>2017-04-09 02:02:40 -0400
commita875299d9aa9f0f1d2e01bedfaae0cb15c182e27 (patch)
tree8b3427e1d9a6cae8f82a0e69877033334d274b25 /keyboards/planck
parent154305ce1be16b2c8abce5e5d4dee421f295d6b3 (diff)
Added breathing macros and removed mappings to unused layouts
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: