Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Planck 2x2U keymap #5519

Merged
merged 43 commits into from
Jun 29, 2019
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
913dabf
Initial keymapping
IsaacElenbaas Feb 12, 2019
5991755
Removed unneccessary config files
IsaacElenbaas Feb 13, 2019
700fb06
Update readme.md
IsaacElenbaas Feb 13, 2019
60dcc37
Updated symbol locations, tap dance on parentheses for brackets.
IsaacElenbaas Feb 17, 2019
dacd277
Merge branch 'master' of github.com:IsaacElenbaas/qmk_firmware
IsaacElenbaas Feb 17, 2019
8c7560d
Update readme.md
IsaacElenbaas Feb 17, 2019
0fa6283
Merge branch 'master' of https://github.com/qmk/qmk_firmware
IsaacElenbaas Feb 17, 2019
4a0d7f5
Merge branch 'master' of github.com:IsaacElenbaas/qmk_firmware
IsaacElenbaas Feb 17, 2019
5d51129
Fixed layout image inconsistencies
IsaacElenbaas Feb 17, 2019
2ce3d3e
More quality shift key layer control, swapped enter + shift enter
IsaacElenbaas Feb 18, 2019
60c33fc
Keyap tweaks and config cleanup
IsaacElenbaas Feb 23, 2019
78930d8
Almost compiling, still has layout reference issues.
IsaacElenbaas Feb 23, 2019
02cb0ad
Merge branch 'master' of https://github.com/qmk/qmk_firmware
IsaacElenbaas Feb 23, 2019
ca48712
Finally compiling. 2x2u layout (default, not mine) had nonexistent ke…
IsaacElenbaas Feb 23, 2019
c5c5b3f
Super minor changes
IsaacElenbaas Mar 3, 2019
92ceda2
Ctrl+Bksp after first tap
IsaacElenbaas Mar 8, 2019
946a422
Changed bind so un/lock is explicit to work with remote un/locking
IsaacElenbaas Mar 24, 2019
0d44d09
Merge branch 'master' of https://github.com/qmk/qmk_firmware
IsaacElenbaas Mar 28, 2019
9737fc3
Added keyboard passwords please don't hate me
IsaacElenbaas Mar 28, 2019
7436c8d
Changed backspace functionality and added em dash
IsaacElenbaas Mar 29, 2019
3b8b953
Changed to send_string because it's preferred for macros
IsaacElenbaas Mar 29, 2019
95ea4c0
Minor fixes
IsaacElenbaas Mar 29, 2019
d1f432c
Merge branch 'master' of github.com:IsaacElenbaas/qmk_firmware
IsaacElenbaas Mar 29, 2019
0346323
Removed global redefinition and fixed possible issue between 6KRO and…
IsaacElenbaas Mar 29, 2019
44c2751
Cleanup
IsaacElenbaas Mar 30, 2019
c11db39
Layer names, password layer is OSL over toggle
IsaacElenbaas Mar 30, 2019
cc206aa
Hopefully now in QMK preferred format.
IsaacElenbaas Mar 31, 2019
9af0d04
Blank passwords.c
IsaacElenbaas Mar 31, 2019
8df5178
Fixed OSLs not cancelling after tapping term
IsaacElenbaas Apr 2, 2019
05ef94b
Matrix change.
IsaacElenbaas Apr 2, 2019
c056f67
Unneeded line.
drashna Apr 2, 2019
9fa4dc2
Fixed return statements to work with after-press functions
IsaacElenbaas Apr 2, 2019
5ef1d93
External image host
IsaacElenbaas Apr 3, 2019
e773a91
Removed image from github
IsaacElenbaas Apr 3, 2019
4ccfeab
Removed unneccessary rules.mk lines and fixed tabbing
IsaacElenbaas Apr 3, 2019
2b1531a
Typos
IsaacElenbaas Apr 3, 2019
55c929f
Fixes upon part arrival.
IsaacElenbaas Apr 13, 2019
99c4a07
Merge branch 'master' of github.com:IsaacElenbaas/qmk_firmware
IsaacElenbaas Apr 13, 2019
f2abb4c
Final changes and bug fixes
IsaacElenbaas Apr 13, 2019
820505a
Preventing KC_NO from waking monitors.
IsaacElenbaas Apr 14, 2019
9ba75a4
Fix to rest of matrices
IsaacElenbaas May 11, 2019
5ae0d57
Merge branch 'master' into master
IsaacElenbaas Jun 13, 2019
b59de68
Workaround for #6214, minor changes, CRLF change in passwords because…
IsaacElenbaas Jun 29, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions keyboards/planck/keymaps/dvorak2space/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once
#define TAPPING_TOGGLE 1
#define PERMISSIVE_HOLD
215 changes: 215 additions & 0 deletions keyboards/planck/keymaps/dvorak2space/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
#include QMK_KEYBOARD_H
#include "passwords.c" //Instead of extern just to cut down on compile time. Holds a single array.
IsaacElenbaas marked this conversation as resolved.
Show resolved Hide resolved
#define MOUSEL KC_BTN1
#define MOUSER KC_BTN2
#define CTRLL LCTL(KC_LEFT)
#define CTRLR LCTL(KC_RGHT)
#define CAD LCTL(LALT(KC_DEL))

#define BASE_L 0
#define SHFT_L 1
#define MOD_L 2
#define NAV_L 3
#define AHK_L 4
#define LOCK_L 5
#define PASS_L 6

enum {
HK_SLP = SAFE_RANGE,
HK_IF,
HK_ELSE,
HK_COSL
};

enum {
FB = 0,
LPN,
RPN,
BCK,
DSH
};

enum {
SINGLE_TAP = 1,
SINGLE_HOLD = 2,
DOUBLE_TAP = 3,
DOUBLE_HOLD = 4,
DOUBLE_SINGLE_TAP = 5, //Distinguishes between double tapping and typing, "tapping", for example. Not sure how accurate it is, and I have no need, so avoiding it at the moment.
TRIPLE_TAP = 6,
TRIPLE_HOLD = 7
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Base
* ,-----------------------------------------------------------------------------------.
* | Tab | ' | , | . | p | y | f | g | c | r | l | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Nav | a | o | e | u | i | d | h | t | n | s | Enter|
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shft | ; | q | j | k | x | b | m | w | v | z | Shft |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Esc | RClk | LClk | Ctrl | Space | Modifier | GUI | VolD | VolU |Macros|
* `-----------------------------------------------------------------------------------'
*/
[0] = LAYOUT_planck_2x2u(
KC_TAB, KC_QUOT,KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, TD(BCK),
MO(NAV_L),KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT,
KC_LSFT, KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT,
KC_ESC, MOUSER, MOUSEL, KC_LCTL, KC_SPC, MO(MOD_L), KC_LGUI, KC_VOLD, KC_VOLU, OSL(AHK_L)
),
/* Custom Shifts
* ,-----------------------------------------------------------------------------------.
* | | | ? | ! | | | | | | | | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[1] = LAYOUT_planck_2x2u(
KC_TRNS,KC_TRNS,KC_SLSH,KC_1, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_NO, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS
),
/* Modifier
* ,-----------------------------------------------------------------------------------.
* | Tab | + | - | * | / \ | if | else | ( [ | ) ] | { | } | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | = | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Enter|
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | ` | < | > | & | | | _ | $ | @ | # | % | ^ | ~ |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | Space | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[2] = LAYOUT_planck_2x2u(
KC_TRNS,KC_PLUS,TD(DSH),KC_ASTR,TD(FB), HK_IF, HK_ELSE,TD(LPN),TD(RPN),KC_LCBR,KC_RCBR,KC_TRNS,
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS,
KC_GRV, KC_LT, KC_GT, KC_AMPR,KC_PIPE,KC_UNDS,KC_DLR, KC_AT, KC_HASH,KC_PERC,KC_CIRC,LSFT(KC_GRV),
KC_NO, KC_NO, KC_NO, KC_NO, KC_SPC, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO
),
//Nav
[3] = LAYOUT_planck_2x2u(
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_HOME,KC_UP, KC_END, KC_NO, KC_TRNS,
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, CTRLL, KC_LEFT,KC_DOWN,KC_RGHT, CTRLR, KC_TRNS,
KC_LSFT,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, KC_SPC, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
),
//AHK-Bindable Macros
[4] = LAYOUT_planck_2x2u(
KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24,
LCTL(KC_F13),LCTL(KC_F14),LCTL(KC_F15),LCTL(KC_F16),LCTL(KC_F17),LCTL(KC_F18),LCTL(KC_F19),LCTL(KC_F20),LCTL(KC_F21),LCTL(KC_F22),LCTL(KC_F23),LCTL(KC_F24),
LSFT(KC_F13),LSFT(KC_F14),LSFT(KC_F15),LSFT(KC_F16),LSFT(KC_F17),LSFT(KC_F18),LSFT(KC_F19),LSFT(KC_F20),LSFT(KC_F21),LSFT(KC_F22),LSFT(KC_F23),LSFT(KC_F24),
RESET, LALT(KC_F14),LALT(KC_F15),OSL(PASS_L), CAD, LALT(KC_F19), LALT(KC_F21),LALT(KC_F22),HK_SLP, HK_COSL
),
//Locked Screen
[5] = LAYOUT_planck_2x2u(
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, HK_SLP, KC_NO
),
//Passwords (by first letter of service name, at least better than just one)
[6] = LAYOUT_planck_2x2u(
KC_NO, KC_NO, KC_NO, KC_NO, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_NO,
KC_NO, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_NO,
KC_NO, KC_NO, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_NO,
KC_NO, KC_NO, KC_NO, HK_COSL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
)
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) { //X_KEY doesn't support aliases
switch(keycode) {
//if shift pressed and not shift layer or released and other shift not pressed
//in separate things because MOD_BIT (probably?) isn't toggled until after this returns true and shift is actually toggled
case KC_LSFT: //if pressed and not shift layer or released and other shift not pressed
if((record->event.pressed && IS_LAYER_OFF(SHFT_L)) || (!record->event.pressed && !(get_mods() & MOD_BIT(KC_RSFT)))) { layer_invert(SHFT_L); }
break;
case KC_RSFT:
if((record->event.pressed && IS_LAYER_OFF(SHFT_L)) || (!record->event.pressed && !(get_mods() & MOD_BIT(KC_LSFT)))) { layer_invert(SHFT_L); }
break;
case KC_ENT: //won't repeat on hold and I can't find a solution other than hardcoding timers but I kinda prefer it anyway. Swaps enter and shift enter
if(record->event.pressed) {
(IS_LAYER_ON(SHFT_L)) //if shifted release correct shift, send, and press same shift, else send shift enter
? (get_mods() & MOD_BIT(KC_LSFT))
? SEND_STRING(SS_UP(X_LSHIFT) SS_TAP(X_ENTER) SS_DOWN(X_LSHIFT))
: SEND_STRING(SS_UP(X_RSHIFT) SS_TAP(X_ENTER) SS_DOWN(X_RSHIFT))
: SEND_STRING(SS_LSFT(SS_TAP(X_ENTER)));
}
return false;
case HK_IF:
if(record->event.pressed) { SEND_STRING("if"); }
break;
case HK_ELSE:
if(record->event.pressed) { SEND_STRING("else"); }
break;
case HK_COSL:
break;
case HK_SLP:
if(record->event.pressed) {
if(IS_LAYER_OFF(LOCK_L)) { SEND_STRING(SS_LALT(SS_TAP(X_F23))); }
else { SEND_STRING(SS_LALT(SS_TAP(X_F24))); }
return false;
}
layer_invert(LOCK_L);
if(IS_LAYER_ON(AHK_L))
layer_invert(AHK_L);
break;
default:
if(IS_LAYER_ON(PASS_L) && keycode <= KC_Z) { SEND_STRING(passwords[keycode - KC_A]); }
}
return true;
};

//tapdance state evaluation
int cur_dance(qk_tap_dance_state_t *state) {
int press = 0;
switch(state->count) {
case 1:
press = (state->interrupted || !state->pressed)
? SINGLE_TAP
: SINGLE_HOLD;
break;
case 2:
press = DOUBLE_TAP;
break;
case 3:
press = TRIPLE_TAP;
}
return press;
}

void back_tap(qk_tap_dance_state_t *state, void *user_data) { tap_code(KC_BSPACE); }

void back_finished(qk_tap_dance_state_t *state, void *user_data) { if(!(state->interrupted || !state->pressed)) { tap_code16(LCTL(KC_BSPACE)); } }

void dash_finished(qk_tap_dance_state_t *state, void *user_data) {
int td_state = cur_dance(state);
switch(td_state) {
case SINGLE_TAP:
tap_code(KC_PMNS);
break;
case SINGLE_HOLD:
register_mods(MOD_BIT(KC_LALT));
tap_code(KC_KP_0);
tap_code(KC_KP_1);
tap_code(KC_KP_5);
tap_code(KC_KP_1);
unregister_mods(MOD_BIT(KC_LALT));
break;
case DOUBLE_TAP:
tap_code(KC_PMNS);
tap_code(KC_PMNS);
}
}

qk_tap_dance_action_t tap_dance_actions[] = {
[FB] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_NUBS),
[LPN] = ACTION_TAP_DANCE_DOUBLE(KC_LPRN, KC_LBRC),
[RPN] = ACTION_TAP_DANCE_DOUBLE(KC_RPRN, KC_RBRC),
[BCK] = ACTION_TAP_DANCE_FN_ADVANCED(back_tap, back_finished, NULL), //each tap, on finished, and reset. Normally register_code on press unregister on reset so keys
[DSH] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dash_finished, NULL) //can be held down, but in both cases a trigger I'm using is holding them down so no point.
};
28 changes: 28 additions & 0 deletions keyboards/planck/keymaps/dvorak2space/passwords.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
char *passwords[26] = {
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
};
5 changes: 5 additions & 0 deletions keyboards/planck/keymaps/dvorak2space/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
![Keyboard Layout](https://i.imgur.com/9jYjllM.png)

# IsaacElenbaas's Planck Layout

Split spacebar, Dvorak. Bottom right button leads to layer with lots of things to be mapped in AutoHotkey. The ones I use (of which the best are sleep, which turns off the monitors and locks all inputs, rebinding keyboard-only mouse inputs, and redirecting media keys to a specific player) can be found [here.](https://github.com/IsaacElenbaas/personal_scripts/blob/master/Keyboard.ahk) Capslock goes to a right-hand navigation layer, there is a custom layer when holding shift, holding dash gives an em dash, holding backspace deletes a word, and I have a obfuscation-based password system you probably shouldn't use, but the rest is pretty standard.
20 changes: 20 additions & 0 deletions keyboards/planck/keymaps/dvorak2space/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work. Can make windows not recognize device.
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
API_SYSEX_ENABLE = no
TAP_DANCE_ENABLE = yes

# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend

LAYOUTS_HAS_RGB = no
2 changes: 1 addition & 1 deletion keyboards/planck/planck.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
{ k06, k07, k08, k09, k0a, k0b }, \
{ k16, k17, k18, k19, k1a, k1b }, \
{ k26, k27, k28, k29, k2a, k2b }, \
{ k36, k37, k38, k33, k34, k35 } \
{ KC_NO, k36, k38, k33, KC_NO, k34 } \
IsaacElenbaas marked this conversation as resolved.
Show resolved Hide resolved
}

#define LAYOUT_planck_grid( \
Expand Down