aboutsummaryrefslogtreecommitdiff
path: root/layouts/community/ergodox/csharp_dev
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-08-23 22:29:07 -0400
committerGitHub <noreply@github.com>2017-08-23 22:29:07 -0400
commitd2ff66a985b938e87fffe55c1d9f1dc55e356f91 (patch)
tree561b3e203033849573a17f5ac6248077ab687676 /layouts/community/ergodox/csharp_dev
parent7260fc3eef98fb7b0e2ed24d3d0d14cf2e613000 (diff)
downloadqmk_firmware-d2ff66a985b938e87fffe55c1d9f1dc55e356f91.tar.gz
qmk_firmware-d2ff66a985b938e87fffe55c1d9f1dc55e356f91.zip
Creates a layouts/ folder for keymaps shared between keyboards (#1609)
* include variables and .h files as pp directives * start layout compilation * split ergodoxes up * don't compile all layouts for everything * might seg fault * reset layouts variable * actually reset layouts * include rules.mk instead * remove includes from rules.mk * update variable setting * load visualizer from path * adds some more examples * adds more layouts * more boards added * more boards added * adds documentation for layouts * use lowercase names for LAYOUT_ * add layout.json files for each layout * add community folder, default keymaps for layouts * touch-up default layouts * touch-up layouts, some keyboard rules.mk * update documentation for layouts * fix up serial/i2c switches
Diffstat (limited to 'layouts/community/ergodox/csharp_dev')
-rw-r--r--layouts/community/ergodox/csharp_dev/keymap.c239
-rw-r--r--layouts/community/ergodox/csharp_dev/readme.md48
2 files changed, 287 insertions, 0 deletions
diff --git a/layouts/community/ergodox/csharp_dev/keymap.c b/layouts/community/ergodox/csharp_dev/keymap.c
new file mode 100644
index 000000000..7996c92e0
--- /dev/null
+++ b/layouts/community/ergodox/csharp_dev/keymap.c
@@ -0,0 +1,239 @@
1#include QMK_KEYBOARD_H
2#include "debug.h"
3#include "action_layer.h"
4
5#define BASE 0 // default layer
6#define FKEYS 1 // F keys + macros
7
8#define MACRO_PUBLIC 10
9#define MACRO_PRIVATE 11
10
11#define MACRO_STATIC 12
12#define MACRO_CONST 13
13
14#define MACRO_VOID 14
15#define MACRO_VAR 15
16#define MACRO_STRING 16
17
18#define MACRO_INT 17
19#define MACRO_FLOAT 18
20#define MACRO_BOOL 19
21
22#define MACRO_RETURN 20
23#define MACRO_NULL 21
24#define MACRO_BREAK 22
25
26#define MACRO_TODO 23
27#define MACRO_NEW 24
28#define MACRO_PARENTHESE 25
29
30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
31/* Keymap 0: Basic layer
32 *
33 * ,--------------------------------------------------. ,--------------------------------------------------.
34 * | ( | 1 | 2 | 3 | 4 | 5 | " | | Save | 6 | 7 | 8 | 9 | 0 | [ |
35 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
36 * | ) | Q | W | E | R | T |Bkspa | | Del | Y | U | I | O | P | ] |
37 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
38 * | { | A | S | D | F | G |------| |------| H | J | K | L | _ | Redo |
39 * |--------+------+------+------+------+------| / | | ; |------+------+------+------+------+--------|
40 * | } |Z~Alt | X | C | V | B | | | | N | M | ' | ! | ? | Undo |
41 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
42 * |Tab~CL| < | > | | | & | | = | + | - | * | L1 |
43 * `----------------------------------' `----------------------------------'
44 * ,-------------. ,-------------.
45 * |. ~L1 | , | |Home |End~L1|
46 * ,------|------|------| |------+------+------.
47 * | | | Copy | | UP | | |
48 * | Enter| Space|------| |------| Space|Enter |
49 * | ~WIN | ~LSFT| Past | | DOWN | ~LSFT| ~WIN |
50 * `--------------------' `--------------------'
51 */
52// If it accepts an argument (i.e, is a function), it doesn't need KC_.
53// Otherwise, it needs KC_*
54[BASE] = LAYOUT_ergodox( // layer 0 : default
55 // left hand
56 KC_LPRN, KC_1, KC_2, KC_3, KC_4, KC_5, LSFT(KC_QUOTE),
57 KC_RPRN, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPACE,
58 KC_LCBR, KC_A, KC_S, KC_D, KC_F, KC_G,
59 KC_RCBR, ALT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_SLASH,
60 CTL_T(KC_TAB), LSFT(KC_COMMA),LSFT(KC_DOT),KC_PIPE,KC_AMPR,
61 LT(1,KC_DOT), KC_COMM,
62 LCTL(KC_C),
63 GUI_T(KC_ENTER),SFT_T(KC_SPACE),LCTL(KC_V),
64 // right hand
65 LCTL(KC_S) , KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRACKET,
66 KC_DELETE, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRACKET,
67 KC_H, KC_J, KC_K, KC_L, KC_UNDS,LCTL(KC_Y),
68 KC_SCOLON,KC_N, KC_M, KC_QUOTE ,KC_EXLM , LSFT(KC_SLASH), LCTL(KC_Z),
69 KC_EQUAL,KC_PLUS , KC_MINUS,KC_ASTR , TG(1),
70 KC_HOME, LT(1,KC_END),
71 KC_UP,
72 KC_DOWN,SFT_T(KC_SPACE), GUI_T(KC_ENTER)
73 ),
74
75/* Keymap 1: F keys + macros
76 *
77 * ,--------------------------------------------------. ,--------------------------------------------------.
78 * | ESC | F1 | F2 | F3 | F4 | F5 | ` | | Calc | F6 | F7 | F8 | F9 | F10 | F11 |
79 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
80 * | Tab |Public|Static|string|int |return| | | |//TODO| | | | | F12 |
81 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
82 * | |Privat|Const |var |float |null |------| |------|new | | | | | |
83 * |--------+------+------+------+------+------| \ | | ~ |------+------+------+------+------+--------|
84 * | | | |void |bool |break;| | | |(); | | | | | |
85 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
86 * | | WIN | Alt | | | | PgUp | PgDw | Ins | PtSc | |
87 * `----------------------------------' `----------------------------------'
88 * ,-------------. ,-------------.
89 * | | Cut | | | |
90 * ,------|------|------| |------+------+------.
91 * | | | | | | | |
92 * | | |------| |------| Left | Right|
93 * | | | | | | | |
94 * `--------------------' `--------------------'
95 */
96// FKEYS + MACROS
97[FKEYS] = LAYOUT_ergodox(
98 // left hand
99 KC_ESCAPE,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_GRAVE,
100 KC_TAB,M(MACRO_PUBLIC),M(MACRO_STATIC), M(MACRO_STRING),M(MACRO_INT),M(MACRO_RETURN),KC_TRNS,
101 KC_TRNS,M(MACRO_PRIVATE),M(MACRO_CONST), M(MACRO_VAR),M(MACRO_FLOAT),M(MACRO_NULL),
102 KC_TRNS,KC_TRNS,KC_TRNS,M(MACRO_VOID),M(MACRO_BOOL),M(MACRO_BREAK),KC_BSLASH,
103 KC_TRNS,KC_LGUI,KC_LALT,KC_TRNS,KC_TRNS,
104 KC_TRNS,LCTL(KC_X),
105 KC_TRNS,
106 KC_TRNS,KC_TRNS,KC_TRNS,
107 // right hand
108 KC_CALCULATOR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
109 KC_TRNS, M(MACRO_TODO), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12,
110 M(MACRO_NEW), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
111 KC_TILD, M(MACRO_PARENTHESE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
112 KC_PGUP,KC_PGDOWN, KC_INSERT, KC_PSCREEN, KC_TRNS,
113 KC_TRNS, KC_TRNS,
114 KC_TRNS,
115 KC_TRNS, KC_LEFT, KC_RIGHT
116),
117
118
119};
120
121const uint16_t PROGMEM fn_actions[] = {
122 [1] = ACTION_LAYER_TAP_TOGGLE(FKEYS) // FN1 - Momentary Layer 1
123};
124
125const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
126{
127 // MACRODOWN only works in this function
128 switch(id) {
129 case MACRO_PUBLIC:
130 if (record->event.pressed) {
131 return MACRO( T(P), T(U), T(B), T(L), T(I), T(C), T(SPACE),END);
132 }
133 break;
134 case MACRO_PRIVATE:
135 if (record->event.pressed) {
136 return MACRO( T(P), T(R), T(I), T(V), T(A), T(T), T(E), T(SPACE),END);
137 }
138 break;
139 case MACRO_STATIC:
140 if (record->event.pressed) {
141 return MACRO( T(S), T(T), T(A), T(T), T(I), T(C), T(SPACE), END);
142 }
143 break;
144 case MACRO_CONST:
145 if (record->event.pressed) {
146 return MACRO( T(C), T(O), T(N), T(S), T(T), T(SPACE), END);
147 }
148 break;
149 case MACRO_VOID:
150 if (record->event.pressed) {
151 return MACRO( T(V), T(O), T(I), T(D), T(SPACE), END);
152 }
153 break;
154 case MACRO_VAR:
155 if (record->event.pressed) {
156 return MACRO( T(V), T(A), T(R), T(SPACE), END);
157 }
158 break;
159 case MACRO_STRING:
160 if (record->event.pressed) {
161 return MACRO( T(S), T(T), T(R), T(I), T(N), T(G), T(SPACE), END);
162 }
163 break;
164 case MACRO_BOOL:
165 if (record->event.pressed) {
166 return MACRO( T(B), T(O), T(O), T(L), T(SPACE), END);
167 }
168 break;
169 case MACRO_INT:
170 if (record->event.pressed) {
171 return MACRO( T(I), T(N), T(T), T(SPACE), END);
172 }
173 break;
174 case MACRO_FLOAT:
175 if (record->event.pressed) {
176 return MACRO( T(F), T(L), T(O), T(A),T(T),T(SPACE), END);
177 }
178 break;
179 case MACRO_RETURN:
180 if (record->event.pressed) {
181 return MACRO( T(R), T(E), T(T), T(U),T(R),T(N), END);
182 }
183 break;
184 case MACRO_NULL:
185 if (record->event.pressed) {
186 return MACRO( T(N), T(U), T(L), T(L), END);
187 }
188 case MACRO_BREAK:
189 if (record->event.pressed) {
190 return MACRO( T(B), T(R), T(E), T(A), T(K), T(SCOLON), END);
191 }
192 break;
193 case MACRO_TODO:
194 if (record->event.pressed) {
195 return MACRO( T(SLASH), T(SLASH), D(LSHIFT) ,T(T), T(O), T(D), T(O),U(LSHIFT), T(SPACE),END);
196 }
197 break;
198 case MACRO_NEW:
199 if (record->event.pressed) {
200 return MACRO( T(N), T(E), T(W), T(SPACE), END);
201 }
202 break;
203 case MACRO_PARENTHESE:
204 if (record->event.pressed) {
205 return MACRO( D(LSHIFT),T(9), T(0),U(LSHIFT), T(SCOLON), END);
206 }
207 break;
208 }
209 return MACRO_NONE;
210};
211
212// Runs just one time when the keyboard initializes.
213void matrix_init_user(void) {
214
215};
216
217// Runs constantly in the background, in a loop.
218void matrix_scan_user(void) {
219
220 uint8_t layer = biton32(layer_state);
221
222 ergodox_board_led_off();
223 ergodox_right_led_1_off();
224 ergodox_right_led_2_off();
225 ergodox_right_led_3_off();
226 switch (layer) {
227 // TODO: Make this relevant to the ErgoDox EZ.
228 case 1:
229 ergodox_right_led_1_on();
230 break;
231 case 2:
232 ergodox_right_led_2_on();
233 break;
234 default:
235 // none
236 break;
237 }
238
239};
diff --git a/layouts/community/ergodox/csharp_dev/readme.md b/layouts/community/ergodox/csharp_dev/readme.md
new file mode 100644
index 000000000..980480d62
--- /dev/null
+++ b/layouts/community/ergodox/csharp_dev/readme.md
@@ -0,0 +1,48 @@
1# ErgoDox EZ C# Developer configuration
2
3## Changelog
4
5* Feb 12, 2016 (V1):
6 * First version commit
7* Mar 20, 2016 (V2):
8 * Removed "Classic QWERTY" layer, inverted GUI and SHIFT on Hold for Space and Enter
9
10## About
11This layout was conceived in an attempt to optimise keyboard layout for developers (C# more specifically, but it can work with most of other languages), and limit the keys required to perform the most frequent actions.
12
13I came to the realization that my main tool as a developer, the qwerty keyboard was something that did not evolved at its core in almost 150 years.
14There are a lot of reasons to this, and it would be a massive entreprise to change a standard so strongly anchored, but I wanted to give it a try and see how would look an input device dedicated to developers, more specifically a C# developer in my case.
15The biggest flaw in standard QWERTY keyboards was that I always needed to perform key combination to access commonly used characters or actions. Think about it a minute, how many times a day do you press a modifier key such as Ctrl or Shift, it's insane and could be so easily optimized to require only one key press.
16
17Then I came across the ErgoDox EZ project, that allowed a full customization of its firmware, and a unique 2 parts design.
18
19![CSharpDev](https://i.imgur.com/PkNqi7V.png)
20![CSharpDev](https://i.imgur.com/0IcMgMf.png)
21
22## Layout design principles
23* No key combination required for the most common input characters ( (),[],{},<> ... )
24* No key combination required for the most common actions (copy/paste/undo/save)
25* Regroup characters by usage ( + - * = ...)
26* Easy access to the most commonly used characters: ; / " . ,
27* Preregistered macro for the most common C# langage instructions: public / private / string / int / float ...
28
29## Why is it specific to C Sharp
30I defined the characters priority based on their usage in C# language, most of this characters are also used in other coding languages but it may require some tweaking.
31For example there is no direct access to ~ or $ keys which can be very common in some languages.
32Note it is also specific to Windows environement as the shortcut used in action keys would not work on Mac Os
33
34## In usage
35It was relatively easy to get used to the layout, but it's hard for me to define how easy it was as I was getting used to a blank Ergodox keyboard at the same time.
36Still it's extremely satisfying to Save your file with just one easily accessible key or to have one big key to end your code line ( ; )
37
38## Improvements
39This layout was shared after a bunch of iterations and only once I was happy with it.
40Still there are many way to improve or iterate on this:
41* Make it language agnostic
42* Check and compile language's keyboard's heatmaps to statistically define keys priority (e.g. https://dzone.com/articles/most-pressed-keys-various )
43* QWERTY is still not the most efficient typing layout, I would like to create a Dvorak based similar layout in a near futur
44
45## Issues
46One of the issues encountered while creating this layout was that I did not find a way to have a key to send a modifier on hold, and a key combination while pressed (e.g. I can't set a Key to do Save (Ctrl + S) when pressed and Shift modifier when hold )
47
48