aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/planck/keymaps/jeremy-dev/keymap.c180
-rw-r--r--keyboards/planck/keymaps/jeremy-dev/readme.md85
2 files changed, 265 insertions, 0 deletions
diff --git a/keyboards/planck/keymaps/jeremy-dev/keymap.c b/keyboards/planck/keymaps/jeremy-dev/keymap.c
new file mode 100644
index 000000000..e7ed09b12
--- /dev/null
+++ b/keyboards/planck/keymaps/jeremy-dev/keymap.c
@@ -0,0 +1,180 @@
1// This is the personal keymap of Jeremy Cowgar (@jcowgar). It is written for the programmer.
2
3// Configuration options
4#define PREVENT_STUCK_MODIFIERS
5
6#include "planck.h"
7#include "action_layer.h"
8#include "eeconfig.h"
9
10// Each layer gets a name for readability, which is then used in the keymap matrix below.
11enum my_layers {
12 ALPH = 0,
13 NUMS,
14 CURS,
15 SYMB,
16 FKEY
17};
18
19// Each macro gets a name for readability.
20enum my_keycodes {
21 MY_ABVE = SAFE_RANGE,
22 MY_BELW,
23 MY_TERM,
24 MY_DEQL, // /=
25 MY_MEQL, // *=
26 MY_SEQL, // -=
27 MY_PEQL, // +=
28 MY_NEQL, // !=
29 MY_LTGT, // <>
30 MY_DPIP, // ||
31 MY_DAMP, // &&
32};
33
34const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
35 [ALPH] = {
36 {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P},
37 {KC_A, KC_S, KC_D, KC_F, KC_G, KC_LPRN, KC_RPRN, KC_H, KC_J, KC_K, KC_L, KC_SCLN},
38 {SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_LCBR, KC_RCBR, KC_N, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH)},
39 {CTL_T(KC_TAB), OSL(FKEY), OSL(NUMS), OSL(SYMB), KC_SPC, ALT_T(KC_BSPC), GUI_T(KC_DELT), KC_ENT, OSL(SYMB), OSL(CURS), TG(CURS), CTL_T(KC_ESC)}
40 },
41 [NUMS] = {
42 {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_COMM, KC_7, KC_8, KC_9, KC_SLSH},
43 {KC_LSFT, KC_LGUI, KC_LALT, KC_LCTL, KC_NO, KC_TRNS, KC_TRNS, KC_LPRN, KC_4, KC_5, KC_6, KC_ASTR},
44 {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_RPRN, KC_1, KC_2, KC_3, KC_MINS},
45 {KC_NO, KC_NO, KC_TRNS, TG(NUMS), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_DOT, KC_EQL, KC_PLUS}
46 },
47 [CURS] = {
48 {KC_MPLY, KC_BSPC, KC_UP, KC_DELT, KC_PGUP, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO},
49 {KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_TRNS, KC_TRNS, KC_NO, KC_LCTL, KC_LALT, KC_LGUI, KC_LSFT},
50 {KC_VOLD, KC_NO, MY_ABVE, MY_TERM, KC_NO, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_LSFT},
51 {KC_MUTE, KC_NO, MY_BELW, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_NO}
52 },
53 [SYMB] = {
54 {MY_DEQL, MY_MEQL, MY_SEQL, MY_PEQL, MY_NEQL, KC_NO, KC_NO, MY_LTGT, KC_LABK, KC_RABK, KC_COLN, KC_DLR},
55 {KC_SLSH, KC_ASTR, KC_MINS, KC_PLUS, KC_EQL, KC_NO, KC_PIPE, MY_DPIP, KC_GRV, KC_QUOT, KC_DQUO, KC_HASH},
56 {KC_BSLS, KC_CIRC, KC_PERC, KC_UNDS, KC_NO, KC_NO, KC_AMPR, MY_DAMP, KC_TILD, KC_AT, KC_EXLM, KC_QUES},
57 {KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO}
58 },
59 [FKEY] = {
60 {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F9, KC_F10, KC_F11, KC_F12},
61 {KC_LSFT, KC_LGUI, KC_LALT, KC_LCTL, KC_NO, KC_NO, KC_NO, KC_NO, KC_F5, KC_F6, KC_F7, KC_F8},
62 {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F1, KC_F2, KC_F3, KC_F4},
63 {KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO}
64 }
65};
66
67void press_key(uint16_t key) {
68 register_code(key);
69 unregister_code(key);
70}
71
72void press_two_keys(uint16_t key1, uint16_t key2) {
73 register_code(key1);
74 register_code(key2);
75 unregister_code(key2);
76 unregister_code(key1);
77}
78
79void press_three_keys(uint16_t key1, uint16_t key2, uint16_t key3) {
80 register_code(key1);
81 register_code(key2);
82 register_code(key3);
83 unregister_code(key3);
84 unregister_code(key2);
85 unregister_code(key1);
86}
87
88bool process_record_user(uint16_t keycode, keyrecord_t *record) {
89 switch (keycode) {
90 case MY_BELW:
91 if (record->event.pressed) {
92 press_two_keys(KC_LGUI, KC_RGHT);
93 press_key(KC_ENT);
94 }
95
96 return false;
97
98 case MY_ABVE:
99 if (record->event.pressed) {
100 press_two_keys(KC_LGUI, KC_LEFT);
101 press_key(KC_ENT);
102 press_key(KC_UP);
103 }
104
105 return false;
106
107 case MY_TERM:
108 if (record->event.pressed) {
109 press_three_keys(KC_LGUI, KC_LSFT, KC_ENT);
110 }
111
112 return false;
113
114 case MY_DEQL: // /=
115 if (record->event.pressed) {
116 press_key(KC_SLSH);
117 press_key(KC_EQL);
118 }
119
120 return false;
121
122 case MY_MEQL: // *=
123 if (record->event.pressed) {
124 press_two_keys(KC_LSFT, KC_ASTR);
125 press_key(KC_EQL);
126 }
127
128 return false;
129
130 case MY_SEQL: // -=
131 if (record->event.pressed) {
132 press_key(KC_MINS);
133 press_key(KC_EQL);
134 }
135
136 return false;
137
138 case MY_PEQL: // +=
139 if (record->event.pressed) {
140 press_two_keys(KC_LSFT, KC_PLUS);
141 press_key(KC_EQL);
142 }
143
144 return false;
145
146 case MY_NEQL: // !=
147 if (record->event.pressed) {
148 press_two_keys(KC_LSFT, KC_EXLM);
149 press_key(KC_EQL);
150 }
151
152 return false;
153
154 case MY_LTGT: // <>
155 if (record->event.pressed) {
156 press_two_keys(KC_LSFT, KC_LABK);
157 press_two_keys(KC_LSFT, KC_RABK);
158 }
159
160 return false;
161
162 case MY_DPIP: // ||
163 if (record->event.pressed) {
164 press_two_keys(KC_LSFT, KC_PIPE);
165 press_two_keys(KC_LSFT, KC_PIPE);
166 }
167
168 return false;
169
170 case MY_DAMP: // &&
171 if (record->event.pressed) {
172 press_two_keys(KC_LSFT, KC_AMPR);
173 press_two_keys(KC_LSFT, KC_AMPR);
174 }
175
176 return false;
177 }
178
179 return true;
180}
diff --git a/keyboards/planck/keymaps/jeremy-dev/readme.md b/keyboards/planck/keymaps/jeremy-dev/readme.md
new file mode 100644
index 000000000..b6a402d69
--- /dev/null
+++ b/keyboards/planck/keymaps/jeremy-dev/readme.md
@@ -0,0 +1,85 @@
1Jeremy Cowgar's Planck Keymap
2=============================
3
4I am a programmer by trade and suffer from the beginning stages of RSI. As a programmer, I use letters, symbols and cursor navigation most often. To prevent strange finger gymnastics, I wrote a script to rank which non-letter characters occurred in my primary source projects most often and then placed these characters in the easiest to reach locations, within reason and for me. I made heavy use of momentary layer toggling.
5
6Layers
7------
8
9The key mapping is made up of 5 layers: Letters, Symbols, Navigation, Numbers, and Function Keys.
10
11The layout can be viewed visually at:
12
13http://www.keyboard-layout-editor.com/#/gists/319474e5e2d199e583371ed1d2aec316
14
15* Purple buttons are dual function keys.
16* Green buttons are layer momentary toggle keys.
17* Red buttons are layer persistent toggle keys.
18
19The keys have multiple symbols:
20
21* Upper left: standard layer, the letter layer
22* Upper right: function layer
23* Lower left: navigation layer
24* Lower right: symbol layer
25
26The symbols in the layout editor are not entirely clear.
27
28The Z and ? keys double as shift keys. Hold for a shift, tap for a Z or ?
29
30The bottom row from left to right:
31
32* Tab when pressed, Control when held. It also is the volume mute key when in the "Navigation" layer
33* Function layer momentary toggle
34* Number layer momentary toggle
35* Symbol layer momentary toggle. When in the "Number" layer, this key also makes the "Number" layer sticky for using the 10 key for quite a bit of entry
36* Space
37* Backspace when tapped, Option when held
38* Delete when tapped, Command when held
39* Return
40* Symbol layer momentary toggle. When in the "Number" layer, key also is the zero key.
41* Navigation layer momentary toggle
42* Navigation layer toggle. This was included for when you are browsing a website, document or otherwise wish to stay in navigation mode. When in the "Number" layer, the key is the = symbol
43* Escape when pressed, Control when held. When in the "Number" layer, the key is the + symbol
44
45General Notes
46-------------
47
48The letter layer is separated by 2 center rows of keys. This spreads the hands out a little further which helps not twist the wrists as much. The 2 center rows are [], (), [], and Ctrl and Alt keys.
49
50The symbol layer keys are accessed by the thumbs. They are the closest to the thumbs, instead of the number toggle, because in my code I found I used symbols much more often than numbers. There are two symbol layer keys because the symbols spread across the right and left half of the keyboard. Thus, some symbols are easier hit with the left hand modifier or right hand modifier.
51
52The number layer key is only accessible by the left thumb because all of the number keys are on the right side of the keyboard. When in the number layer, you can press the key to the right to make that layer sticky when you are going to do a lot of number entry.
53
54The function layer key is only accessible by the left thumb because all of the function keys are on the right side of the keyboard.
55
56The navigation layer key is only accessible by the right thumb because all of the navigation keys are on the left side of the keyboard. You can press the key to the right of the navigation layer to make the navigation layer sticky when you are doing a lot of navigation, reading a web page for example.
57
58When using the number or navigation layers, the same hand that accesses the momentary layer toggle key also has the 4 primary modifiers under their home row.
59
60* Pointer finger is control
61* Middle finger is option
62* Ring finger is command
63* Pinky finger is shift
64
65This is so you can easily press Cmd+Shift+F4 or when navigating, select text or words of text by pressing Shift+Control, for example.
66
67Some keys are duplicated. For example, () are available in easy to reach locations while in the Number layer because they are often used in math.
68
69The symbol layer has additional helpers for programming including a single keys that enter /=, \*=, -=, +=, !=, <>, ||, and &&. It also includes three special Return keys on the left:
70
71* Up CR which moves the cursor up, to the end of the line and then presses CR
72* Down CR which moves the cursor to the end of the line and then presses CR
73* Right ; which moves the cursor to the end of the line and presses ; for C styled languages, such as JavaScript which is a primary language I use
74
75Word of Warning
76---------------
77
78I have been using the keymap for some time now and believe it to be a good keymap. There are a few things through the week that I wonder if it would have been better if this key were moved to that location.
79
80This keymap may change for further optimization.
81
82Please Give Feedback!
83---------------------
84
85I am very interested in your feedback. Send me a message here on GitHub, r/jcowgar or @jcowgar.