summaryrefslogtreecommitdiffstats
path: root/keyboards/planck
diff options
context:
space:
mode:
authorajp10304 <a.Pocklington@Gmail.com>2018-03-13 07:22:35 +0100
committerJack Humbert <jack.humb@gmail.com>2018-03-13 07:22:35 +0100
commitadded1f062345a365c7004b9c17a7c1a473ab4bd (patch)
tree97bc2481e444650cfe7d3b82f966a353219b31a6 /keyboards/planck
parente8e999dcc0d99fef28031f7b262102536f16da00 (diff)
downloadqmk_firmware-added1f062345a365c7004b9c17a7c1a473ab4bd.tar.gz
qmk_firmware-added1f062345a365c7004b9c17a7c1a473ab4bd.tar.xz
Planck ajp10304 (#2519)
* Planck ajp10304 layout clean up * Planck ajp10304 layout add Mac layer extensions * JJ40 ajp10304 layout add Mac layer extensions
Diffstat (limited to 'keyboards/planck')
-rw-r--r--keyboards/planck/keymaps/ajp10304/keymap.c105
-rw-r--r--keyboards/planck/keymaps/ajp10304/readme.md4
2 files changed, 92 insertions, 17 deletions
diff --git a/keyboards/planck/keymaps/ajp10304/keymap.c b/keyboards/planck/keymaps/ajp10304/keymap.c
index da1b5e8ed..18a3f486d 100644
--- a/keyboards/planck/keymaps/ajp10304/keymap.c
+++ b/keyboards/planck/keymaps/ajp10304/keymap.c
@@ -5,22 +5,28 @@
extern keymap_config_t keymap_config;
-// 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 _LOWER 1
-#define _RAISE 2
-#define _FUNC 3
-#define _ADJUST 16
-#define _DYN 6
+enum planck_layers {
+ _QWERTY,
+ _MAC,
+ _LOWER,
+ _MLWR,
+ _RAISE,
+ _MRSE,
+ _FUNC,
+ _MFNC,
+ _ADJUST,
+ _DYN
+};
enum planck_keycodes {
QWERTY = SAFE_RANGE,
+ MAC,
FUNC,
+ MFNC,
LOWER,
+ MLWR,
RAISE,
+ MRSE,
DYNAMIC_MACRO_RANGE
};
@@ -117,10 +123,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = {
- {M(0), RESET, QWERTY, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL },
- {KC_CAPS, _______, _______, _______, _______, _______, _______, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ },
- {_______, _______, _______, _______, _______, _______, _______, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ },
- {_______, _______, _______, _______, _______, _______, _______, _______, MO(_DYN), _______, _______, _______ }
+ {M(0), RESET, QWERTY, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL },
+ {KC_CAPS, _______, _______, _______, _______, _______, _______, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ },
+ {TG(_MAC), _______, _______, _______, _______, _______, _______, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ },
+ {_______, _______, _______, _______, _______, _______, _______, _______, MO(_DYN), _______, _______, _______ }
},
/* DYN: Macro Recording and Playback
@@ -141,8 +147,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
},
-};
+[_MAC]= {
+ {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
+ {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
+ {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
+ {_______, _______, _______, _______, MLWR, _______, _______, MRSE, _______, _______, _______, _______}
+},
+
+[_MLWR] = {
+ {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
+ {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
+ {_______, KC_GRAVE, KC_NONUS_BSLASH, _______, _______, _______, _______, _______, _______, _______, _______, _______},
+ {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
+},
+
+[_MRSE] = {
+ {_______, _______, M(2), _______, _______, _______, _______, _______, _______, _______, _______, _______ },
+ {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_EQL) },
+ {_______, _______, _______, _______, _______, _______, LALT(KC_LEFT), _______, _______, _______, LALT(KC_RIGHT), LGUI(KC_MINS) },
+ {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
+},
+
+[_MFNC]= {
+ {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
+ {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_PENT) },
+ {_______, KC_GRAVE, KC_NONUS_BSLASH, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
+ {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
+},
+
+};
void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
@@ -179,10 +213,42 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
- }
+ case MLWR:
+ if (record->event.pressed) {
+ layer_on(_LOWER);
+ layer_on(_MLWR);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ } else {
+ layer_off(_LOWER);
+ layer_off(_MLWR);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ }
+ return false;
+ case MRSE:
+ if (record->event.pressed) {
+ layer_on(_RAISE);
+ layer_on(_MRSE);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ } else {
+ layer_off(_RAISE);
+ layer_off(_MRSE);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ }
+ return false;
+ case MFNC:
+ if (record->event.pressed) {
+ layer_on(_FUNC);
+ layer_on(_MFNC);
+ } else {
+ layer_off(_FUNC);
+ layer_off(_MFNC);
+ }
+ return false;
+ }
return true;
}
+
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch(id) {
// These would trigger when you hit a key mapped as M(0)
@@ -201,6 +267,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
END
);
}
+ case 2: // Word Select - MAC
+ if (record->event.pressed) {
+ return MACRO(
+ DOWN(KC_LALT), DOWN(KC_RIGHT), UP(KC_RIGHT), DOWN(KC_LSFT), DOWN(KC_LEFT), UP(KC_LEFT), UP(KC_LSFT), UP(KC_LALT),
+ END
+ );
+ }
}
return MACRO_NONE;
};
diff --git a/keyboards/planck/keymaps/ajp10304/readme.md b/keyboards/planck/keymaps/ajp10304/readme.md
index 8f9edbcc2..69b08ed51 100644
--- a/keyboards/planck/keymaps/ajp10304/readme.md
+++ b/keyboards/planck/keymaps/ajp10304/readme.md
@@ -65,12 +65,14 @@ Activated when `Lower` and `Raise` are held together the above `qwerty` layer.
* Reset: Enter bootloader for flashing firmware to the keyboard.
* CAPS: Toggle caps lock.
* DYN: Enter `DYN` layer.
+* MAC: Toggle MAC OS extensions to layers. This allows MLWR to be enabled with LOWER,
+MRSE with RAISE and MFNC with FUNC respectively.
| | | | | | | | | | | | |
| :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:|
| ???? | Reset|Qwerty| | | | | | | | | Del |
| CAPS | | | | | | | Mute | Vol+ | Play | | |
-| | | | | | | | Prev | Vol- | Next | | |
+| MAC | | | | | | | Prev | Vol- | Next | | |
| | | | | | | | | DYN | | | |
##### DYN