summaryrefslogtreecommitdiffstats
path: root/keyboards
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-04-12 12:45:03 -0400
committerGitHub <noreply@github.com>2017-04-12 12:45:03 -0400
commit0de2597f7cf6483457fb50efb9edd28d2f0cc26d (patch)
tree3a40a2891579eb871e91bc99e3f31d4e8b651e84 /keyboards
parentb7f1ea967afcfc326c2183e491677a6a40435edb (diff)
parenta875299d9aa9f0f1d2e01bedfaae0cb15c182e27 (diff)
Merge pull request #1216 from Khord/master
Added breathing macros/mappings and removed mappings to unused layouts
Diffstat (limited to 'keyboards')
-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: