diff options
Diffstat (limited to 'keyboards/jd45')
-rw-r--r-- | keyboards/jd45/keymaps/blakedietz/README.md | 129 | ||||
-rw-r--r-- | keyboards/jd45/keymaps/blakedietz/blank_key_template.md | 13 | ||||
-rw-r--r-- | keyboards/jd45/keymaps/blakedietz/config.h | 31 | ||||
-rw-r--r-- | keyboards/jd45/keymaps/blakedietz/keymap.c | 342 |
4 files changed, 515 insertions, 0 deletions
diff --git a/keyboards/jd45/keymaps/blakedietz/README.md b/keyboards/jd45/keymaps/blakedietz/README.md new file mode 100644 index 000000000..2e45a46d9 --- /dev/null +++ b/keyboards/jd45/keymaps/blakedietz/README.md | |||
@@ -0,0 +1,129 @@ | |||
1 | jeebak's JD45 layout | ||
2 | ======================= | ||
3 | NOTE: This is a port of jeebak's planck layout, for jd45. | ||
4 | |||
5 | This WIP keymap attempts to minimize fingers straying away from the home row. | ||
6 | To aid in this endeavor, when additional modifyer keys to switch layers are | ||
7 | needed, they will be mapped to home row keys. The `keymap.c` file will contain | ||
8 | the exact changes. The diagrams in this README shows the highlights of the | ||
9 | changes from the default mappings. | ||
10 | |||
11 | I also decided to change all calls to `persistant_default_layer_set()` to | ||
12 | `default_layer_set()` since this is my personal perference. | ||
13 | |||
14 | ## Macros | ||
15 | ``` | ||
16 | #define ALT_TAB M(KC_ALT_TAB) | ||
17 | ``` | ||
18 | |||
19 | ## Base Layers (Qwerty/Colemak/Dvorak) | ||
20 | These base layers are mostly the same as the default mappings. The interesting | ||
21 | changes are shown below. | ||
22 | |||
23 | - The `Ctrl/Esc`, will emit an `Escape` when tapped, and act as a `Control` key when held, | ||
24 | - `GUI/;` as `;` and `GUI`, | ||
25 | - `Alt/"` as `"` and `Alt`, | ||
26 | - `Sft/Ent` as `Enter` and `Shift`, and | ||
27 | - `Hyper/Tab` as `Tab` and `Hyper` | ||
28 | |||
29 | A `TODO` item is to see if it can also act as a `CapsLock` when double-tapped. | ||
30 | The arrow keys, which have been moved to the | ||
31 | [TouchCursor](http://martin-stone.github.io/touchcursor/) layer, have been | ||
32 | replaced with the Media keys as shown. The `MC/kc` key activates the | ||
33 | `MouseCursor` layer when held, and emits the corresponding `kc` for its layer, | ||
34 | when tapped. | ||
35 | ``` | ||
36 | ,---------+------+------+------+------+------+------+------+------+------+------+------+------. | ||
37 | |Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | [ | Bksp | | ||
38 | |---------`------`------`------`------`------`------`------`------`------`------`------`------| | ||
39 | | Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L |GUI/; | Alt/" | | ||
40 | |----------`------`------`------`------`------`------`------`------`------`------`------------| | ||
41 | | Shift | Z | X | C | V | B | N | M | , | . | / | Sft/Ent | | ||
42 | |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| | ||
43 | | RGUI | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol- | Vol+ | Play | | ||
44 | `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' | ||
45 | ``` | ||
46 | |||
47 | ## Lower Layer (Symbols and Function Keys) | ||
48 | The symbols and functions keys are essentially the same as the default mapping. | ||
49 | The most notable changes are that the symbol keys from the `RAISE` layer have | ||
50 | been moved here. The remaining Media keys replace those that are now on the | ||
51 | base layers. The `BACKLIT` key has also been moved here. | ||
52 | ``` | ||
53 | ,---------+------+------+------+------+------+------+------+------+------+------+------+------. | ||
54 | | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | Bksp | | ||
55 | |---------`------`------`------`------`------`------`------`------`------`------`------`------| | ||
56 | | [ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | "|" | | ||
57 | |----------`------`------`------`------`------`------`------`------`------`------`------------| | ||
58 | | ] | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | | ||
59 | |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| | ||
60 | | Brite | | | | | | | Prev | Next | Mute | | ||
61 | `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' | ||
62 | ``` | ||
63 | |||
64 | ## Raise Layer (Numbers and Arithmetic Operators) | ||
65 | All of the numbers and arithmetic operators are available on this layer. Some | ||
66 | keys are duplicated for the convenience of their positions. The `0` and `$` | ||
67 | keys at the far left are for quick access to beginning and end of line in vim. | ||
68 | ``` | ||
69 | ,---------+------+------+------+------+------+------+------+------+------+------+------+------. | ||
70 | | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | Bksp | | ||
71 | |---------`------`------`------`------`------`------`------`------`------`------`------`------| | ||
72 | | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | "|" | | ||
73 | |----------`------`------`------`------`------`------`------`------`------`------`------------| | ||
74 | | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ | | ||
75 | |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| | ||
76 | | Brite | | | | | | | Prev | Next | Mute | | ||
77 | `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' | ||
78 | ``` | ||
79 | |||
80 | ## TouchCursor layer plus personal customizations | ||
81 | [TouchCursor](http://martin-stone.github.io/touchcursor/) uses the `Space` key | ||
82 | as the modifier, with the `IJKL` home row keys representing the inverted-T of | ||
83 | the arrow keys. All of the default TouchCursor keymappings for the right hand | ||
84 | are represented below. My personalizations include all of the keys shown for | ||
85 | the left hand. Having the `Alt` and `Shift` keys (as well as the `Control` key | ||
86 | from the base layers) readily accessible from the home row allows quick word | ||
87 | jumps and highlighting when used in conjunction with the arrow keys. The | ||
88 | `Alt-Tab` macro is not only useful under Windows, but also under Mac when used | ||
89 | with alternative switchers like [HyperSwitch](https://bahoom.com/hyperswitch). | ||
90 | The `Cmd-Tab` and `Ctrl-Tab` sequences are duplicated for easy access while in | ||
91 | this layer. The `KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND,` and `KC_AGAIN` | ||
92 | keycodes do not seem to work. There are macros in place that'll "automatically" | ||
93 | choose the correct version (`Cmd-Tab` vs. `Alt-Tab`, `Cmd-C` vs. `Ctrl-C`, | ||
94 | etc.) depending on which layout you've currently selected (`AG_NORM` or | ||
95 | `AG_SWAP`) in the `_ADJUST` layer. The `Desk_L` and `Desk_R` macros are what I | ||
96 | use to switch between Virtual Desktops Left/Right. The `Tab_C`, `Tab_N` and | ||
97 | `Tab_R` are for "Close Tab," "New Tab" and "Reopen Closed Tab" for apps such as | ||
98 | Google Chrome. | ||
99 | ``` | ||
100 | ,---------+------+------+------+------+------+------+------+------+------+------+------+------. | ||
101 | | AltTab |CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | | | ||
102 | |---------`------`------`------`------`------`------`------`------`------`------`------`------| | ||
103 | | | Alt |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L| Desk_R | | ||
104 | |----------`------`------`------`------`------`------`------`------`------`------`------------| | ||
105 | | | Undo | Cut | Copy |Paste | ` | PgDn | Del |Tab_N |Tab_R |iTerm2| | | ||
106 | |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| | ||
107 | | | | | | | | | | | | | ||
108 | `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' | ||
109 | ``` | ||
110 | |||
111 | ## Mouse Layer | ||
112 | The Mouse layer, closely mimics the layout/behaviour of the TouchCursor layer. | ||
113 | The `D` key (on QWERTY) is used to activate this layer. All 16 keycodes for the | ||
114 | mouse from the `doc/keycode.txt` file are represented, and logically located, | ||
115 | IMHO. The left and right click buttons are duplicated; on the right hand side, | ||
116 | for a quick click here and there, and again on the left hand side for when the | ||
117 | buttons need to be held for dragging things or highlighting text, thus allowing | ||
118 | the right hand to be free to use the up/down/left/right actions. | ||
119 | ``` | ||
120 | ,---------+------+------+------+------+------+------+------+------+------+------+------+------. | ||
121 | | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | | | ||
122 | |---------`------`------`------`------`------`------`------`------`------`------`------`------| | ||
123 | | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 | | ||
124 | |----------`------`------`------`------`------`------`------`------`------`------`------------| | ||
125 | | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | | | ||
126 | |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| | ||
127 | | | | | | | | | | | | | ||
128 | `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' | ||
129 | ``` | ||
diff --git a/keyboards/jd45/keymaps/blakedietz/blank_key_template.md b/keyboards/jd45/keymaps/blakedietz/blank_key_template.md new file mode 100644 index 000000000..2a58cfdd1 --- /dev/null +++ b/keyboards/jd45/keymaps/blakedietz/blank_key_template.md | |||
@@ -0,0 +1,13 @@ | |||
1 | ``` | ||
2 | /* Name | ||
3 | * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. | ||
4 | * | | | | | | | | | | | | | | | ||
5 | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| | ||
6 | * | | | | | | | | | | | | | | ||
7 | * |----------`------`------`------`------`------`------`------`------`------`------`------------| | ||
8 | * | | | | | | | | | | | | | | ||
9 | * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| | ||
10 | * | | | | | | | | | | | | ||
11 | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' | ||
12 | */ | ||
13 | ``` | ||
diff --git a/keyboards/jd45/keymaps/blakedietz/config.h b/keyboards/jd45/keymaps/blakedietz/config.h new file mode 100644 index 000000000..6667d6fa1 --- /dev/null +++ b/keyboards/jd45/keymaps/blakedietz/config.h | |||
@@ -0,0 +1,31 @@ | |||
1 | #include "../../config.h" | ||
2 | |||
3 | /** | ||
4 | *JD45 keymap definition macro | ||
5 | */ | ||
6 | #define KEYMAP_JD45( \ | ||
7 | K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, \ | ||
8 | K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, \ | ||
9 | K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, \ | ||
10 | K38, K39, K40, K41, K42, K43, K44, K45, K46, K47 \ | ||
11 | ) { \ | ||
12 | { K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13 }, \ | ||
13 | { K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, KC_NO }, \ | ||
14 | { K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, KC_NO }, \ | ||
15 | { K38, K39, K40, K41, K42, KC_NO, K43, KC_NO, K44, K45, K46, K47, KC_NO } \ | ||
16 | } | ||
17 | |||
18 | /** | ||
19 | * This makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when | ||
20 | * you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) | ||
21 | */ | ||
22 | #define IGNORE_MOD_TAP_INTERRUPT | ||
23 | |||
24 | /** | ||
25 | * Improve the smootheness of mouse interaction | ||
26 | */ | ||
27 | #define MOUSEKEY_INTERVAL 20 | ||
28 | #define MOUSEKEY_DELAY 0 | ||
29 | #define MOUSEKEY_TIME_TO_MAX 5 | ||
30 | #define MOUSEKEY_MAX_SPEED 2 | ||
31 | #define MOUSEKEY_WHEEL_DELAY 0 \ No newline at end of file | ||
diff --git a/keyboards/jd45/keymaps/blakedietz/keymap.c b/keyboards/jd45/keymaps/blakedietz/keymap.c new file mode 100644 index 000000000..1b1d0817e --- /dev/null +++ b/keyboards/jd45/keymaps/blakedietz/keymap.c | |||
@@ -0,0 +1,342 @@ | |||
1 | #include "jd45.h" | ||
2 | |||
3 | extern keymap_config_t keymap_config; | ||
4 | |||
5 | /* | ||
6 | * Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
7 | * The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
8 | * Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
9 | * entirely and just use numbers. | ||
10 | */ | ||
11 | #define _ADJUST 16 | ||
12 | #define _LOWER 3 | ||
13 | #define _MEDIA 8 | ||
14 | #define _MOUSECURSOR 7 | ||
15 | #define _QWERTY 0 | ||
16 | #define _RAISE 4 | ||
17 | #define _VIM 9 | ||
18 | // TODO: (bdietz) - make a symbols layer for fun emoji and ascii art | ||
19 | // TODO: (bdietz) - make a symbol layer for greek symbols | ||
20 | |||
21 | // Keycodes | ||
22 | enum planck_keycodes { | ||
23 | QWERTY = SAFE_RANGE, | ||
24 | LOWER, | ||
25 | RAISE, | ||
26 | }; | ||
27 | |||
28 | enum macro_keycodes { | ||
29 | KC_ALT_TAB, | ||
30 | KC_CMD_TAB, | ||
31 | KC_CTL_TAB, | ||
32 | KC_CMD_SLSH, | ||
33 | KC_AG_FIND, | ||
34 | KC_AG_AGAIN, | ||
35 | KC_AG_UNDO, | ||
36 | KC_AG_CUT, | ||
37 | KC_AG_COPY, | ||
38 | KC_AG_PASTE, | ||
39 | KC_AG_DESK_L, | ||
40 | KC_AG_DESK_R, | ||
41 | KC_AG_TAB_C, | ||
42 | KC_AG_TAB_N, | ||
43 | KC_AG_TAB_R, | ||
44 | }; | ||
45 | |||
46 | // Fillers to make layering more clear | ||
47 | #define _______ KC_TRNS | ||
48 | #define XXXXXXX KC_NO | ||
49 | |||
50 | /** | ||
51 | * This section of macros is for tap or hold functionality. Keys will fire off the second symbol in the name if tapped | ||
52 | * or fire the first symbol in the name if held. For example | ||
53 | * GUI_Z | ||
54 | * | ||
55 | * - will fire z if tapped | ||
56 | * - will fire cmd/super/win if held | ||
57 | */ | ||
58 | #define ALT_DOT ALT_T(KC_DOT) | ||
59 | #define ALT_X ALT_T(KC_X) | ||
60 | #define CTL_SLSH CTL_T(KC_SLSH) | ||
61 | #define CTL_Z CTL_T(KC_Z) | ||
62 | #define GUI_C GUI_T(KC_C) | ||
63 | #define GUI_COMM GUI_T(KC_COMM) | ||
64 | #define HPR_ESC ALL_T(KC_ESC) | ||
65 | #define HPR_QUO ALL_T(KC_QUOT) | ||
66 | |||
67 | // Toggle to VIM when left space button is held, emit space keycode when left space is tapped | ||
68 | #define TGL_VIM LT(_VIM, KC_SPC) | ||
69 | // Toggle to the mouse layer when the right space button is held and emit enter when right space is tapped | ||
70 | #define TGL_MOUSE LT(_MOUSECURSOR, KC_ENT) | ||
71 | |||
72 | // TODO: (bdietz) - need to audit these keycodes to see what sort of cool things the default layout was doing. | ||
73 | #define ALT_TAB M(KC_ALT_TAB) // Macro for Alt-Tab | ||
74 | #define CMD_TAB M(KC_CMD_TAB) // Macro for Cmd-Tab | ||
75 | #define CTL_TAB M(KC_CTL_TAB) // Macro for Ctl-Tab | ||
76 | #define CMD_SLSH M(KC_CMD_SLSH) // Macro for Cmd-Slash (personal shortcut to toggle iTerm2 visibility) | ||
77 | #define AG_FIND M(KC_AG_FIND) // Macros for Cmd-[x] vs Ctrl-[x] based on current AG_NORM or AG_SWAP settings | ||
78 | #define AG_AGAIN M(KC_AG_AGAIN) | ||
79 | #define AG_UNDO M(KC_AG_UNDO) | ||
80 | #define AG_CUT M(KC_AG_CUT) | ||
81 | #define AG_COPY M(KC_AG_COPY) | ||
82 | #define AG_PASTE M(KC_AG_PASTE) | ||
83 | #define AG_D_L M(KC_AG_DESK_L) // For Virtual Desktop Switching: Left, and | ||
84 | #define AG_D_R M(KC_AG_DESK_R) // Right | ||
85 | #define AG_T_C M(KC_AG_TAB_C) // For Chrome, etc. Tab Close, | ||
86 | #define AG_T_N M(KC_AG_TAB_N) // Tab New, and | ||
87 | #define AG_T_R M(KC_AG_TAB_R) // Tab Reopen Closed | ||
88 | |||
89 | /* Qwerty | ||
90 | * | ||
91 | * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. | ||
92 | * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | | | ||
93 | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| | ||
94 | * |Hyper/Esc| A | S | D | F | G | H | J | K | L |MEDIA/;| Hyper/" | | ||
95 | * |----------`------`------`------`------`------`------`------`------`------`------`------------| | ||
96 | * | Shift |CTL/Zl|ALT/X |GUI/C | V | B | N | M |GUI/, | ALT/.|CTL// | Shift | | ||
97 | * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| | ||
98 | * | | | | Lower | VIM/Space| MOUSE/Ent| Raise | | | | | ||
99 | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' | ||
100 | */ | ||
101 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
102 | [_QWERTY] = KEYMAP_JD45( | ||
103 | /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ | ||
104 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, ALL_T(KC_NO), | ||
105 | /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ | ||
106 | HPR_ESC , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_MEDIA, KC_SCLN), HPR_QUO, | ||
107 | /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ | ||
108 | KC_LSFT, CTL_Z, ALT_X, GUI_C, KC_V, KC_B, KC_N, KC_M,GUI_COMM, ALT_DOT, CTL_SLSH, KC_RSFT , | ||
109 | /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ | ||
110 | _______ , _______ , _______ , LOWER , TGL_VIM , TGL_MOUSE , RAISE , _______ , _______ , _______), | ||
111 | /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ | ||
112 | |||
113 | // TODO: (bdietz) - update the keymap documentation to include the modifier keys on the third row | ||
114 | /* Lower | ||
115 | * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. | ||
116 | * | ` | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | Bksp | | ||
117 | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| | ||
118 | * | [ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | "|" | | ||
119 | * |----------`------`------`------`------`------`------`------`------`------`------`------------| | ||
120 | * | ] | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | | ||
121 | * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| | ||
122 | * | | | | | | | | Prev | Next | Mute | | ||
123 | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' | ||
124 | */ | ||
125 | [_LOWER] = KEYMAP_JD45( | ||
126 | /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ | ||
127 | KC_GRV,KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, KC_BSPC, | ||
128 | /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ | ||
129 | KC_LBRC , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE , | ||
130 | /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ | ||
131 | KC_RBRC , CTL_T(KC_F7), ALT_T(KC_F8),GUI_T(KC_F9), KC_F10, KC_F11, KC_F12, KC_MINS, GUI_T(KC_EQL) , ALT_T(KC_LBRC), CTL_T(KC_RBRC), KC_BSLS , | ||
132 | /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ | ||
133 | _______ , _______, _______, _______, _______ , _______ , _______, KC_MPRV, KC_MNXT, KC_MUTE), | ||
134 | /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ | ||
135 | |||
136 | /* Raise | ||
137 | * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. | ||
138 | * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | Bksp | | ||
139 | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| | ||
140 | * | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | "|" | | ||
141 | * |----------`------`------`------`------`------`------`------`------`------`------`------------| | ||
142 | * | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ | | ||
143 | * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| | ||
144 | * | | | | | | | | Prev | Next | Mute | | ||
145 | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' | ||
146 | */ | ||
147 | [_RAISE] = KEYMAP_JD45( | ||
148 | /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ | ||
149 | KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_BSPC, | ||
150 | /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ | ||
151 | KC_DLR , KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_DOT, KC_4, KC_5, KC_6, KC_ASTR, KC_PIPE , | ||
152 | /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ | ||
153 | KC_EQL , CTL_T(KC_7), ALT_T(KC_8), GUI_T(KC_9), KC_0, KC_MINS, KC_DOT, KC_1 ,GUI_T(KC_2), ALT_T(KC_3), CTL_T(KC_SLSH), KC_BSLS , | ||
154 | /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ | ||
155 | _______ , _______, _______, _______, _______ , _______ , _______, KC_MPRV, KC_MNXT, KC_MUTE), | ||
156 | /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ | ||
157 | |||
158 | /* Mouse Layer | ||
159 | * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. | ||
160 | * | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | | | ||
161 | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| | ||
162 | * | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 | | ||
163 | * |----------`------`------`------`------`------`------`------`------`------`------`------------| | ||
164 | * | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | | | ||
165 | * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| | ||
166 | * | | | | | | | | | | | | ||
167 | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' | ||
168 | */ | ||
169 | |||
170 | [_MOUSECURSOR] = KEYMAP_JD45( | ||
171 | /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ | ||
172 | _______,_______, _______, KC_MS_U, _______, _______, _______, KC_ACL2, KC_ACL1, KC_ACL0, _______, _______, _______, | ||
173 | /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ | ||
174 | _______ ,_______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, KC_BTN1, KC_BTN2, _______, _______, _______ , | ||
175 | /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ | ||
176 | _______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , | ||
177 | /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ | ||
178 | _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______), | ||
179 | /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ | ||
180 | |||
181 | /* Adjust (Lower + Raise) | ||
182 | * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. | ||
183 | * | | | | | | | | | | | | | Del | | ||
184 | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| | ||
185 | * | | | | | |AGnorm|AGswap|Qwerty|Mouse | |Plover| | | ||
186 | * |----------`------`------`------`------`------`------`------`------`------`------`------------| | ||
187 | * | | | | | | | | | | | | | | ||
188 | * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| | ||
189 | * | | | | | | | | | | Reset | | ||
190 | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' | ||
191 | */ | ||
192 | [_ADJUST] = KEYMAP_JD45( | ||
193 | |||
194 | /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ | ||
195 | _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , | ||
196 | /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ | ||
197 | _______ ,_______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______ , | ||
198 | /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ | ||
199 | _______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , | ||
200 | /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ | ||
201 | _______ , _______, _______, _______, _______ , _______ , _______, _______, _______, RESET), | ||
202 | /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ | ||
203 | |||
204 | /* VIM | ||
205 | * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. | ||
206 | * | | | | | | | | | | | | | | | ||
207 | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| | ||
208 | * | | | | | | | LEFT | DOWN | UP |RIGHT | | | | ||
209 | * |----------`------`------`------`------`------`------`------`------`------`------`------------| | ||
210 | * | | | | | | | | | | | | | | ||
211 | * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| | ||
212 | * | | | | | | | | | | | | ||
213 | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' | ||
214 | */ | ||
215 | [_VIM] = KEYMAP_JD45( | ||
216 | /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ | ||
217 | _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
218 | /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ | ||
219 | _______ ,_______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______ , | ||
220 | /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ | ||
221 | _______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , | ||
222 | /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ | ||
223 | _______ , _______, _______, _______, _______ , _______ , _______, _______, _______,_______), | ||
224 | /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ | ||
225 | |||
226 | /* Media | ||
227 | * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. | ||
228 | * | | | | | | | | | | | | | | | ||
229 | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| | ||
230 | * | | | | | | | | Prev | Next | Mute | | Play/Pause | | ||
231 | * |----------`------`------`------`------`------`------`------`------`------`------`------------| | ||
232 | * | | | | | | | | VolD | VolU | | | | | ||
233 | * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| | ||
234 | * | | | | | | | | | | | | ||
235 | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' | ||
236 | */ | ||
237 | [_MEDIA] = KEYMAP_JD45( | ||
238 | /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ | ||
239 | _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
240 | /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ | ||
241 | _______ ,_______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_MUTE, _______, KC_MPLY , | ||
242 | /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ | ||
243 | _______ ,_______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, _______, _______, _______ , | ||
244 | /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ | ||
245 | _______ , _______, _______, _______, _______ , _______ , _______, _______, _______, _______) | ||
246 | /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ | ||
247 | }; | ||
248 | |||
249 | void persistant_default_layer_set(uint16_t default_layer) { | ||
250 | eeconfig_update_default_layer(default_layer); | ||
251 | default_layer_set(default_layer); | ||
252 | } | ||
253 | |||
254 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
255 | switch (keycode) { | ||
256 | case QWERTY: | ||
257 | if (record->event.pressed) { | ||
258 | default_layer_set(1UL<<_QWERTY); | ||
259 | } | ||
260 | return false; | ||
261 | break; | ||
262 | case LOWER: | ||
263 | if (record->event.pressed) { | ||
264 | layer_on(_LOWER); | ||
265 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
266 | } else { | ||
267 | layer_off(_LOWER); | ||
268 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
269 | } | ||
270 | return false; | ||
271 | break; | ||
272 | case RAISE: | ||
273 | if (record->event.pressed) { | ||
274 | layer_on(_RAISE); | ||
275 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
276 | } else { | ||
277 | layer_off(_RAISE); | ||
278 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
279 | } | ||
280 | return false; | ||
281 | break; | ||
282 | } | ||
283 | return true; | ||
284 | } | ||
285 | |||
286 | /* | ||
287 | * Macro definition | ||
288 | */ | ||
289 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | ||
290 | { | ||
291 | if (!eeconfig_is_enabled()) { | ||
292 | eeconfig_init(); | ||
293 | } | ||
294 | |||
295 | bool use_cmd = true; // Use, for example, Cmd-Tab, Cmd-C, Cmd-V, etc. | ||
296 | // Compare to MAGIC_SWAP_ALT_GUI and MAGIC_UNSWAP_ALT_GUI configs, set in: | ||
297 | // quantum/quantum.c | ||
298 | if(keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1) { | ||
299 | use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc. | ||
300 | } | ||
301 | |||
302 | switch (id) { | ||
303 | case KC_ALT_TAB: | ||
304 | if(use_cmd) { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } | ||
305 | else { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } | ||
306 | case KC_CMD_TAB: | ||
307 | if(use_cmd) { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } | ||
308 | else { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } | ||
309 | |||
310 | case KC_CTL_TAB: | ||
311 | return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END )); | ||
312 | case KC_CMD_SLSH: | ||
313 | return (record->event.pressed ? MACRO( D(LGUI), D(SLSH),END ) : MACRO( U(SLSH),END )); | ||
314 | |||
315 | case KC_AG_FIND: | ||
316 | return use_cmd ? MACRODOWN( D(LGUI), T(F), END ) : MACRODOWN( D(LCTRL), T(F), END ); | ||
317 | case KC_AG_AGAIN: | ||
318 | return use_cmd ? MACRODOWN( D(LGUI), T(G), END ) : MACRODOWN( D(LCTRL), T(G), END ); | ||
319 | case KC_AG_UNDO: | ||
320 | return use_cmd ? MACRODOWN( D(LGUI), T(Z), END ) : MACRODOWN( D(LCTRL), T(Z), END ); | ||
321 | case KC_AG_CUT: | ||
322 | return use_cmd ? MACRODOWN( D(LGUI), T(X), END ) : MACRODOWN( D(LCTRL), T(X), END ); | ||
323 | case KC_AG_COPY: | ||
324 | return use_cmd ? MACRODOWN( D(LGUI), T(C), END ) : MACRODOWN( D(LCTRL), T(C), END ); | ||
325 | case KC_AG_PASTE: | ||
326 | return use_cmd ? MACRODOWN( D(LGUI), T(V), END ) : MACRODOWN( D(LCTRL), T(V), END ); | ||
327 | |||
328 | case KC_AG_DESK_L: | ||
329 | return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(SCLN), END ) : MACRODOWN( D(LALT), D(LCTRL), T(SCLN), END ); | ||
330 | case KC_AG_DESK_R: | ||
331 | return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(QUOT), END ) : MACRODOWN( D(LALT), D(LCTRL), T(QUOT), END ); | ||
332 | |||
333 | case KC_AG_TAB_C: | ||
334 | return use_cmd ? MACRODOWN( D(LGUI), T(W), END ) : MACRODOWN( D(LCTRL), T(W), END ); | ||
335 | case KC_AG_TAB_N: | ||
336 | return use_cmd ? MACRODOWN( D(LGUI), T(T), END ) : MACRODOWN( D(LCTRL), T(T), END ); | ||
337 | case KC_AG_TAB_R: | ||
338 | return use_cmd ? MACRODOWN( D(LGUI), D(LSHIFT), T(T), END ) : MACRODOWN( D(LCTRL), D(LSHIFT), T(T), END ); | ||
339 | } | ||
340 | |||
341 | return MACRO_NONE; | ||
342 | } | ||