Planck ajp10304 (#2519)

* Planck ajp10304 layout clean up

* Planck ajp10304 layout add Mac layer extensions

* JJ40 ajp10304 layout add Mac layer extensions
master
ajp10304 2018-03-13 06:22:35 +00:00 committed by Jack Humbert
parent e8e999dcc0
commit added1f062
4 changed files with 202 additions and 53 deletions

View File

@ -5,22 +5,28 @@
extern keymap_config_t keymap_config; extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below. enum jj40_layers {
// The underscores don't mean anything - you can have a layer called STUFF or any other name. _QWERTY,
// Layer names don't all need to be of the same length, obviously, and you can also skip them _MAC,
// entirely and just use numbers. _LOWER,
#define _QWERTY 0 _MLWR,
#define _LOWER 1 _RAISE,
#define _RAISE 2 _MRSE,
#define _FUNC 3 _FUNC,
#define _ADJUST 16 _MFNC,
#define _DYN 6 _ADJUST,
_DYN
};
enum planck_keycodes { enum jj40_keycodes {
QWERTY = SAFE_RANGE, QWERTY = SAFE_RANGE,
MAC,
FUNC, FUNC,
MFNC,
LOWER, LOWER,
MLWR,
RAISE, RAISE,
MRSE,
DYNAMIC_MACRO_RANGE DYNAMIC_MACRO_RANGE
}; };
@ -117,10 +123,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_ADJUST] = KEYMAP(\ [_ADJUST] = KEYMAP(\
M(0), RESET, QWERTY, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL ,\ M(0), RESET, QWERTY, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL ,\
KC_CAPS, _______, _______, _______, _______, _______, _______, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ ,\ 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, _______, _______ ,\ TG(_MAC), _______, _______, _______, _______, _______, _______, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ ,\
_______, _______, _______, _______, _______, _______, _______, _______, MO(_DYN), _______, _______, _______ \ _______, _______, _______, _______, _______, _______, _______, _______, MO(_DYN), _______, _______, _______ \
), ),
/* DYN: Macro Recording and Playback /* DYN: Macro Recording and Playback
@ -139,11 +145,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, _______, _______, _______, _______, _______,\ _______, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, _______, DYN_REC_STOP, DYN_REC_STOP, _______, _______, _______, _______, _______,\ _______, _______, _______, _______, _______, DYN_REC_STOP, DYN_REC_STOP, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______\ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______\
),
[_MAC]= KEYMAP(\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, MLWR, _______, _______, MRSE, _______, _______, _______, _______\
),
[_MLWR] = KEYMAP(\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
_______, KC_GRAVE, KC_NONUS_BSLASH, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______\
),
[_MRSE] = KEYMAP(\
_______, _______, M(2), _______, _______, _______, _______, _______, _______, _______, _______, _______ ,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_EQL) ,\
_______, _______, _______, _______, _______, _______, LALT(KC_LEFT), _______, _______, _______, LALT(KC_RIGHT), LGUI(KC_MINS) ,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
[_MFNC]= KEYMAP(\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_PENT) ,\
_______, KC_GRAVE, KC_NONUS_BSLASH, _______, _______, _______, _______, _______, _______, _______, _______, _______ ,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
) )
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
@ -179,10 +212,42 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
} }
return false; 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; return true;
} }
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch(id) { switch(id) {
// These would trigger when you hit a key mapped as M(0) // These would trigger when you hit a key mapped as M(0)
@ -201,6 +266,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
END 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; return MACRO_NONE;
}; };

View File

@ -1,12 +1,12 @@
# AJP10304 Custom JJ40 Layout # AJP10304 Custom JJ40 Layout
###Based on my Planck layout of the same name. ###Based on my Planck layout of the same name.
**Note:** In the tables below where there are two characters on a key, **Note:** In the tables below where there are two characters on a key,
the second is the output when shift is applied. the second is the output when shift is applied.
**Note:** The below tables assume a UK layout. **Note:** The below tables assume a UK layout.
##### Main Qwerty Layer ##### Main Qwerty Layer
* Tab: when held, operates as shift. * Tab: when held, operates as shift.
* Enter: when held, operates as shift. * Enter: when held, operates as shift.
@ -33,7 +33,7 @@ Activated when `fn` held in the above `qwerty` layer.
Activated when `Lower` is held in the above `qwerty` layer. Activated when `Lower` is held in the above `qwerty` layer.
* Numbers are along the top row, their shifted counterparts are on row 2. * Numbers are along the top row, their shifted counterparts are on row 2.
* WrdBks: `backspace` with `ctrl` applied. I.e. delete a word. * WrdBks: `backspace` with `ctrl` applied. I.e. delete a word.
* WrdDel: `delete` with `ctrl` applied. I.e. forward delete a word. * WrdDel: `delete` with `ctrl` applied. I.e. forward delete a word.
| | | | | | | | | | | | | | | | | | | | | | | | | |
@ -42,45 +42,47 @@ Activated when `Lower` is held in the above `qwerty` layer.
| ! | " | £ | $ | % | ^ | & | * | ( | ) |WrdDel|WrdBks| | ! | " | £ | $ | % | ^ | & | * | ( | ) |WrdDel|WrdBks|
| Shift | \| | `¬ | #~ | '@ | -_ | =+ | #~ | [{ | ]} | '@ |Shift | | Shift | \| | `¬ | #~ | '@ | -_ | =+ | #~ | [{ | ]} | '@ |Shift |
| | | | |Lower | Del |Space | | Next | Vol- | Vol+ | Play | | | | | |Lower | Del |Space | | Next | Vol- | Vol+ | Play |
##### Raise Layer ##### Raise Layer
Activated when `Raise` is held in the above `qwerty` layer. Activated when `Raise` is held in the above `qwerty` layer.
* Preferred layer for typing brackets. * Preferred layer for typing brackets.
* Allows for cursor navigation to be used solely with the right hand. * Allows for cursor navigation to be used solely with the right hand.
* WRDSEL: Select the word where the cursor is. * WRDSEL: Select the word where the cursor is.
* |< and >|: Apply `ctrl` to `left` and `right` respectively for word jumping. * |< and >|: Apply `ctrl` to `left` and `right` respectively for word jumping.
| | | | | | | | | | | | | | | | | | | | | | | | | |
| :---: |:----:| :---:| :---:| :---:| :---:| :---: | :---:| :---:| :---:| :---: | :---:| | :---: |:----:| :---:| :---:| :---:| :---:| :---: | :---:| :---:| :---:| :---: | :---:|
| ` | |WRDSEL| [ | ] | | | PGUP | HOME |PGDOWN| |PRNTSC| | ` | |WRDSEL| [ | ] | | | PGUP | HOME |PGDOWN| |PRNTSC|
| ` | | | ( | ) | | | HOME | UP | END | |ZOOM +| | ` | | | ( | ) | | | HOME | UP | END | |ZOOM +|
| | | | { | } | |&#124;<| LEFT | DOWN |RIGHT |>&#124;|ZOOM -| | | | | { | } | |&#124;<| LEFT | DOWN |RIGHT |>&#124;|ZOOM -|
| | | | | | Alt | Enter |Raise | | | | | | | | | | | Alt | Enter |Raise | | | | |
##### Lower + Raise ##### Lower + Raise
Activated when `Lower` and `Raise` are held together the above `qwerty` layer. Activated when `Lower` and `Raise` are held together the above `qwerty` layer.
* Audio controls in the same position as cursor keys from the `Raise` layer. * Audio controls in the same position as cursor keys from the `Raise` layer.
* ????: Runs a macro for outputting a text string. Do not use this store passwords. * ????: Runs a macro for outputting a text string. Do not use this store passwords.
* Reset: Enter bootloader for flashing firmware to the keyboard. * Reset: Enter bootloader for flashing firmware to the keyboard.
* CAPS: Toggle caps lock. * CAPS: Toggle caps lock.
* DYN: Enter `DYN` layer. * 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 | | ???? | Reset|Qwerty| | | | | | | | | Del |
| CAPS | | | | | | | Mute | Vol+ | Play | | | | CAPS | | | | | | | Mute | Vol+ | Play | | |
| | | | | | | | Prev | Vol- | Next | | | | MAC | | | | | | | Prev | Vol- | Next | | |
| | | | | | | | | DYN | | | | | | | | | | | | | DYN | | | |
##### DYN ##### DYN
Activated when `DYN` held along with `Lower` and `Raise` Activated when `DYN` held along with `Lower` and `Raise`
Allows recording of macros. To start recording the macro, press either REC1 or REC2. Allows recording of macros. To start recording the macro, press either REC1 or REC2.
To finish the recording, press STOP. To replay the macro, press either PLAY1 or PLAY2. To finish the recording, press STOP. To replay the macro, press either PLAY1 or PLAY2.
| | | | | | | | | | | | | | | | | | | | | | | | | |
| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| | :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:|
| | | | | | REC1 | REC2 | | | | | | | | | | | | REC1 | REC2 | | | | | |
| | | | | | PLAY1| PLAY2| | | | | | | | | | | | PLAY1| PLAY2| | | | | |
| | | | | | STOP | STOP | | | | | | | | | | | | STOP | STOP | | | | | |

View File

@ -5,22 +5,28 @@
extern keymap_config_t keymap_config; extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below. enum planck_layers {
// The underscores don't mean anything - you can have a layer called STUFF or any other name. _QWERTY,
// Layer names don't all need to be of the same length, obviously, and you can also skip them _MAC,
// entirely and just use numbers. _LOWER,
#define _QWERTY 0 _MLWR,
#define _LOWER 1 _RAISE,
#define _RAISE 2 _MRSE,
#define _FUNC 3 _FUNC,
#define _ADJUST 16 _MFNC,
#define _DYN 6 _ADJUST,
_DYN
};
enum planck_keycodes { enum planck_keycodes {
QWERTY = SAFE_RANGE, QWERTY = SAFE_RANGE,
MAC,
FUNC, FUNC,
MFNC,
LOWER, LOWER,
MLWR,
RAISE, RAISE,
MRSE,
DYNAMIC_MACRO_RANGE DYNAMIC_MACRO_RANGE
}; };
@ -117,10 +123,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_ADJUST] = { [_ADJUST] = {
{M(0), RESET, QWERTY, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL }, {M(0), RESET, QWERTY, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL },
{KC_CAPS, _______, _______, _______, _______, _______, _______, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ }, {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, _______, _______ }, {TG(_MAC), _______, _______, _______, _______, _______, _______, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ },
{_______, _______, _______, _______, _______, _______, _______, _______, MO(_DYN), _______, _______, _______ } {_______, _______, _______, _______, _______, _______, _______, _______, MO(_DYN), _______, _______, _______ }
}, },
/* DYN: Macro Recording and Playback /* 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) { void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(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); update_tri_layer(_LOWER, _RAISE, _ADJUST);
} }
return false; 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; return true;
} }
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch(id) { switch(id) {
// These would trigger when you hit a key mapped as M(0) // 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 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; return MACRO_NONE;
}; };

View File

@ -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. * Reset: Enter bootloader for flashing firmware to the keyboard.
* CAPS: Toggle caps lock. * CAPS: Toggle caps lock.
* DYN: Enter `DYN` layer. * 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 | | ???? | Reset|Qwerty| | | | | | | | | Del |
| CAPS | | | | | | | Mute | Vol+ | Play | | | | CAPS | | | | | | | Mute | Vol+ | Play | | |
| | | | | | | | Prev | Vol- | Next | | | | MAC | | | | | | | Prev | Vol- | Next | | |
| | | | | | | | | DYN | | | | | | | | | | | | | DYN | | | |
##### DYN ##### DYN