From c52b3c6126228b571891d2ad6553913a6cc7ebf4 Mon Sep 17 00:00:00 2001 From: ajp10304 Date: Thu, 3 May 2018 02:36:15 +0100 Subject: AJP10304 Planck and JJ40 layouts. Added fn2 layer (#2879) --- keyboards/jj40/keymaps/ajp10304/keymap.c | 118 +++++++++++++++++++++++++----- keyboards/jj40/keymaps/ajp10304/readme.md | 52 ++++++++----- 2 files changed, 133 insertions(+), 37 deletions(-) (limited to 'keyboards/jj40') diff --git a/keyboards/jj40/keymaps/ajp10304/keymap.c b/keyboards/jj40/keymaps/ajp10304/keymap.c index 1da57c444..b6d4d7b55 100644 --- a/keyboards/jj40/keymaps/ajp10304/keymap.c +++ b/keyboards/jj40/keymaps/ajp10304/keymap.c @@ -14,6 +14,8 @@ enum jj40_layers { _MRSE, _FUNC, _MFNC, + _FUNC2, + _MFNC2, _ADJUST, _MOUSE }; @@ -23,6 +25,8 @@ enum jj40_keycodes { MAC, FUNC, MFNC, + FUNC2, + MFNC2, LOWER, MLWR, RAISE, @@ -47,14 +51,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shft | Z | X | C | V | B | N | M | ,< | .> | /? | Shft | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Shift| MENU | Ctrl | Fn | + * | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Shift| MENU | Ctrl | Fn2 | * `-----------------------------------------------------------------------------------' */ [_QWERTY] = KEYMAP(\ KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC ,\ MT(MOD_LSFT, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MT(MOD_RSFT, KC_ENT) ,\ KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT ,\ - MO(_FUNC), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LSHIFT, KC_BTN2, KC_RCTL, MO(_FUNC) \ + MO(_FUNC), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LSHIFT, KC_BTN2, KC_RCTL, MO(_FUNC2) \ ), /* Function @@ -117,15 +121,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | CAPS | | | | | PLAY1| PLAY2| Mute | Vol+ | Play | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | STOP | STOP | Prev | Vol- | Next | | | + * | PC/MC| | | | | STOP | STOP | Prev | Vol- | Next | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ [_ADJUST] = KEYMAP(\ - M(0), RESET, QWERTY, _______, _______, DYN_REC_START1, DYN_REC_START2, _______, _______, _______, _______, KC_DEL ,\ - KC_CAPS, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ ,\ - TG(_MAC), _______, _______, _______, _______, DYN_REC_STOP, DYN_REC_STOP, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ ,\ + M(0), RESET, QWERTY, BL_ON, BL_OFF, DYN_REC_START1, DYN_REC_START2, _______, _______, _______, _______, KC_DEL ,\ + KC_CAPS, RGB_TOG, RGB_MOD, RGB_VAD, RGB_VAI, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ ,\ + TG(_MAC), RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, DYN_REC_STOP, DYN_REC_STOP, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ ,\ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), @@ -147,32 +151,57 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______\ ), +/* Function 2 (Right hand side) + * ,-----------------------------------------------------------------------------------. + * | | |WRDSEL| | | | LNDEL| | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | LNSEL| DUP | | | | |LNJOIN| | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | UNDO | CUT | COPY | PASTE| | | | | | | MODE | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FUNC2] = KEYMAP(\ + _______, _______, M(1), _______, _______, _______, M(5), _______, _______, _______, _______, _______,\ + _______, _______, M(3), M(7), _______, _______, _______, M(10), _______, _______, _______, _______,\ + _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), _______, _______, _______, _______, _______, _______, M(98), \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + [_MAC]= KEYMAP(\ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ - _______, _______, _______, _______, MLWR, _______, _______, MRSE, _______, _______, _______, _______\ + MFNC, _______, _______, _______, MLWR, _______, _______, MRSE, _______, _______, _______, MFNC2 \ ), [_MLWR] = KEYMAP(\ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ - _______, KC_GRAVE, KC_NONUS_BSLASH, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), [_MRSE] = KEYMAP(\ - _______, _______, M(2), _______, _______, _______, _______, _______, _______, _______, _______, _______ ,\ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_EQL) ,\ - _______, _______, _______, _______, _______, _______, LALT(KC_LEFT), _______, _______, _______, LALT(KC_RIGHT), LGUI(KC_MINS) ,\ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + _______, _______, M(2), _______, _______, _______, _______, _______, _______, _______, _______, _______ ,\ + _______, _______, _______, _______, _______, _______, _______, LCTL(KC_A), _______, LCTL(KC_E), _______, LGUI(KC_EQL) ,\ + _______, _______, _______, _______, _______, _______, LALT(KC_LEFT), _______, _______, _______, LALT(KC_RIGHT), LGUI(KC_MINS) ,\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), [_MFNC]= KEYMAP(\ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ,\ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_PENT) ,\ - _______, KC_GRAVE, KC_NONUS_BSLASH, _______, _______, _______, _______, _______, _______, _______, _______, _______ ,\ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ,\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_PENT) ,\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ,\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +[_MFNC2] = KEYMAP(\ + _______, _______, M(2), _______, _______, _______, M(6), _______, _______, _______, _______, _______,\ + _______, _______, M(4), M(8), _______, _______, _______, M(10), _______, _______, _______, _______,\ + _______, LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), _______, _______, _______, _______, _______, _______, M(99), \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ) }; @@ -243,6 +272,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_MFNC); } return false; + case MFNC2: + if (record->event.pressed) { + layer_on(_FUNC2); + layer_on(_MFNC2); + } else { + layer_off(_FUNC2); + layer_off(_MFNC2); + } + return false; } return true; } @@ -262,6 +300,48 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t keycode, uint8_t op case 2: // Word Select Mac SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_RIGHT) SS_DOWN(X_LSHIFT) SS_TAP(X_LEFT) SS_UP(X_LSHIFT) SS_UP(X_LALT)); return false; + + case 3: // Line Select + SEND_STRING(SS_TAP(X_HOME) SS_DOWN(X_LSHIFT) SS_TAP(X_END) SS_UP(X_LSHIFT)); + return false; + + case 4: // Line Select Mac + SEND_STRING(SS_LCTRL("a") SS_DOWN(X_LSHIFT) SS_LCTRL("e") SS_UP(X_LSHIFT)); + return false; + + case 5: // Line Delete + SEND_STRING(SS_TAP(X_HOME) SS_DOWN(X_LSHIFT) SS_TAP(X_END) SS_UP(X_LSHIFT)); + SEND_STRING(SS_TAP(X_BSPACE)); + return false; + + case 6: // Line Delete Mac + SEND_STRING(SS_LCTRL("a") SS_DOWN(X_LSHIFT) SS_LCTRL("e") SS_UP(X_LSHIFT)); + SEND_STRING(SS_TAP(X_BSPACE)); + return false; + + case 7: // Duplicate Selection + SEND_STRING(SS_LCTRL("c") SS_TAP(X_RIGHT) SS_LCTRL("v")); + return false; + + case 8: // Duplicate Selection Mac + SEND_STRING(SS_LGUI("c") SS_TAP(X_RIGHT) SS_LGUI("v")); + return false; + + case 9: // Join line + SEND_STRING(SS_TAP(X_END) SS_TAP(X_DELETE)); + return false; + + case 10: // Join line Mac + SEND_STRING(SS_LCTRL("e") SS_TAP(X_DELETE)); + return false; + + case 98: // Print mode + SEND_STRING("PC"); + return false; + + case 99: // Print mode + SEND_STRING("OSX"); + return false; } } return MACRO_NONE; diff --git a/keyboards/jj40/keymaps/ajp10304/readme.md b/keyboards/jj40/keymaps/ajp10304/readme.md index eaaacd05b..7ed6adec7 100644 --- a/keyboards/jj40/keymaps/ajp10304/readme.md +++ b/keyboards/jj40/keymaps/ajp10304/readme.md @@ -17,7 +17,7 @@ the second is the output when shift is applied. | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | | Tab | A | S | D | F | G | H | J | K | L | ;: | Enter| | Shft | Z | X | C | V | B | N | M | ,< | .> | /? | Shft | -| Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Shift| MENU | Ctrl | Fn | +| Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Shift| MENU | Ctrl | Fn2 | ##### Function Layer Activated when `fn` held in the above `qwerty` layer. @@ -27,7 +27,7 @@ Activated when `fn` held in the above `qwerty` layer. | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | 1! | 2" | 3£ | 4$ | 5% | 6^ | 7& | 8* | 9( | 0) | ~ |INSERT| | Shift | \| | `¬ | #~ | * | -_ | =+ | \| | [{ | ]} | '@ |Shift | -| Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Mouse | MENU | Alt | Ctrl | Fn | +| Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Mouse | MENU | Alt | Ctrl | Fn2 | ##### Lower Layer Activated when `Lower` is held in the above `qwerty` layer. @@ -65,28 +65,44 @@ Activated when `Lower` and `Raise` are held together in the above `qwerty` layer * ????: Runs a macro for outputting a text string. Do not use this store passwords. * Reset: Enter bootloader for flashing firmware to the keyboard. * CAPS: Toggle caps lock. +* Macro functions: 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. * MAC: Toggle MAC OS extensions to layers. This allows MLWR to be enabled with LOWER, -MRSE with RAISE and MFNC with FUNC respectively. -* REC1, REC2: Start recording macro. -* PLAY1, PLAY2: Playback macro. -* STOP1, STOP2: Stop recording macro. +MRSE with RAISE, MFNC with FUNC and MFNC2 with FUNC2 respectively. | | | | | | | | | | | | | | :---: |:----:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| | ???? | Reset|Qwerty| | | REC1 | REC2 | | | | | Del | -| CAPS | | | | | PLAY1| PLAY | Mute | Vol+ | Play | | | -| MAC | | | | | STOP | STOP | Prev | Vol- | Next | | | +| CAPS | | | | | PLAY1|PLAY2 | Mute | Vol+ | Play | | | +| MAC | | | | | STOP1|STOP2 | Prev | Vol- | Next | | | +| | | | | | | | | DYN | | | | + +##### Function 2 Layer +Activated when `fn` held in the above `qwerty` layer. +* WRDSEL: Select the word where the cursor is. +* LNDEL: Delete the line where the cursor is. +* LNSEL: Select the line where the cursor is. +* DUP: Duplicate the selected text. +* LNJOIN: Join the line where the cursor is with the following line. +* MODE: Print either `PC` or `OSX` depending on what layer mode is active. + +| | | | | | | | | | | | | +| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| | |WRDSEL| | | | LNDEL| | | | | | +| | | LNSEL| DUP | | | | |LNJOIN| | | | +| | UNDO | CUT | COPY | PASTE| | | | | | | MODE | | | | | | | | | | | | | | - -##### Mouse -Activated when `fn` and `Raise` are held together. -| | | | | | | | | | | | | -| :---: |:----:| :---:| :---:| :---:| :---:| :---: | :---:| :---:| :---:| :---: | :---:| -| | | | | | | | | | | | | -| ACC0 | ACC1 | ACC2 | | | | | BTN1 | UP | BTN2 | | | -| ACC0 | ACC1 | ACC2 | | | | | LEFT | DOWN |RIGHT | | | -| | | | | | | | | | | | | +##### Mouse Layer +Activated when `fn` and `raise` held together. + +| | | | | | | | | | | | | +| :---: | :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| :---:| +| ESC | | | | | | | | | | | | +| ACC0 | ACC1 | ACC2 | | | | | BTN1 | UP | BTN2 | | | +| ACC0 | ACC1 | ACC2 | | | | | LEFT | DOWN | RIGHT| | | +| | | | | | | | | | | | | ####Manual Flashing of hex file -`bootloadHID -r .build/jj40_ajp10304.hex` +Use sleep to get a chance to get into boot mode. +`sleep 5; bootloadHID -r .build/jj40_ajp10304.hex` -- cgit v1.2.3-24-g4f1b