aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-06-07 18:47:29 -0400
committerGitHub <noreply@github.com>2017-06-07 18:47:29 -0400
commit84012d82439f614d4adc8d6af496cac301fab019 (patch)
treef1b0f6493140ff254100bc8e2dcff5f3a128bdd9
parent8cc0035ea05fa46251e0bb5a308208ac27873950 (diff)
parent0db6ac46aa52ff6b09425c0085febeae0c91c0b4 (diff)
downloadqmk_firmware-84012d82439f614d4adc8d6af496cac301fab019.tar.gz
qmk_firmware-84012d82439f614d4adc8d6af496cac301fab019.zip
Merge pull request #1359 from agbell/PR
Permissive Hold, and two keymaps
-rw-r--r--Dockerfile4
-rw-r--r--keyboards/ergodox/keymaps/adam/config.h6
-rw-r--r--keyboards/ergodox/keymaps/adam/keymap.c174
-rw-r--r--keyboards/ergodox/keymaps/adam/readme.md3
-rw-r--r--keyboards/ergodox/readme.md1
-rw-r--r--keyboards/lets_split/keymaps/adam/config.h43
-rw-r--r--keyboards/lets_split/keymaps/adam/keymap.c79
-rw-r--r--keyboards/lets_split/keymaps/adam/makefile1
-rw-r--r--tmk_core/common/action_tapping.c2
9 files changed, 310 insertions, 3 deletions
diff --git a/Dockerfile b/Dockerfile
index 88da06f02..bc0285a44 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -15,6 +15,8 @@ RUN apt-get update && apt-get install --no-install-recommends -y build-essential
15 binutils-arm-none-eabi \ 15 binutils-arm-none-eabi \
16 libnewlib-arm-none-eabi \ 16 libnewlib-arm-none-eabi \
17 git \ 17 git \
18 software-properties-common \
19 avrdude \
18 && rm -rf /var/lib/apt/lists/* 20 && rm -rf /var/lib/apt/lists/*
19 21
20ENV keyboard=ergodox 22ENV keyboard=ergodox
@@ -23,4 +25,4 @@ ENV keymap=default
23 25
24VOLUME /qmk 26VOLUME /qmk
25WORKDIR /qmk 27WORKDIR /qmk
26CMD make clean ; make keyboard=${keyboard} subproject=${subproject} keymap=${keymap} 28CMD make clean; make;
diff --git a/keyboards/ergodox/keymaps/adam/config.h b/keyboards/ergodox/keymaps/adam/config.h
new file mode 100644
index 000000000..b3910bc45
--- /dev/null
+++ b/keyboards/ergodox/keymaps/adam/config.h
@@ -0,0 +1,6 @@
1#include "../../config.h"
2
3#undef TAPPING_TERM
4#define TAPPING_TERM 300 //At 500 some bad logic takes hold
5#define PREVENT_STUCK_MODIFIERS
6#define IGNORE_MOD_TAP_INTERRUPT
diff --git a/keyboards/ergodox/keymaps/adam/keymap.c b/keyboards/ergodox/keymaps/adam/keymap.c
new file mode 100644
index 000000000..432f0fb26
--- /dev/null
+++ b/keyboards/ergodox/keymaps/adam/keymap.c
@@ -0,0 +1,174 @@
1#include "ergodox.h"
2#include "debug.h"
3#include "action_layer.h"
4#include "version.h"
5
6
7#define BASE 0 // default layer
8#define FLOCK 1 // symbols arrows and F keys on F held down
9#define JLOCK 2 // same as Flock but with fall thru J and mapped to J held down
10#define CAPLOCK 3 //caps on until space / enter / esc
11#define SFLOCK 11 // symbols arrows and F keys on F held down
12#define SJLOCK 12 // same as Flock but with fall thru J and mapped to J held down
13
14#define _______ KC_TRNS
15#define XXXXXXX KC_NO
16
17// Sends macro when key is tapped, presses mod when key is held
18#define tap_mod_macro(record, mod, macro) ( ((record)->event.pressed) ? \
19 ( ((record)->tap.count <= 0 || (record)->tap.interrupted) ? MACRO(D(mod), END) : MACRO_NONE ) : \
20 ( ((record)->tap.count > 0 && !((record)->tap.interrupted)) ? (macro) : MACRO(U(mod), END) ) )
21
22#define tap_mod_shift(record, mod, macro) ( ((record)->event.pressed) ? \
23 ( ((record)->tap.count <= 0 || (record)->tap.interrupted) ? MACRO(D(mod), END) : MACRO_NONE ) : \
24 ( ((record)->tap.count > 0 && !((record)->tap.interrupted)) ? (MACRO( D(LSFT), T(LBRC), U(LSFT), END)) : MACRO(U(mod), END) ) )
25
26const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
27/* Layout
28 *
29 * ,--------------------------------------------------. ,--------------------------------------------------.
30 * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | |
31 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
32 * | | Q | W | E | R | T | | | | Y | U | I | O | P | |
33 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
34 * | | A | S | D | F | G |------| |------| H | J | K | L |; | |
35 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
36 * | | Z | X | C | V | B | | | | N | M | , | . | | |
37 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
38 * | | | | | | | | | | | |
39 * `----------------------------------' `----------------------------------'
40 * ,-------------. ,-------------.
41 * | | | | | |
42 * ,------|------|------| |------+--------+------.
43 * | | | | | | | |
44 * | | |------| |------| | |
45 * | | | | | | | |
46 * `--------------------' `----------------------'
47 */
48 [BASE] = KEYMAP(
49 // left hand
50 GUI_T(KC_ESC), KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS,
51 _______, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TAB,
52 _______, SFT_T(KC_A), ALT_T(KC_S), CTL_T(KC_D), F(FLOCK), GUI_T(KC_G),
53 _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC,
54 _______, _______, _______, _______ ,_______,
55 _______, _______,
56 _______,
57 KC_SPC, _______, _______ ,
58
59 // right hand
60 KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
61 KC_TAB, KC_Y, KC_U, KC_I, KC_O, KC_P, _______,
62 GUI_T(KC_H), F(JLOCK), CTL_T(KC_K), ALT_T(KC_L), SFT_T(KC_SCLN), _______,
63 KC_DELETE, KC_N, KC_M, KC_COMM,KC_DOT, KC_QUOT, _______,
64 _______, _______,_______,_______, _______,
65 _______, _______,
66 _______,
67 _______,_______, KC_ENT
68 ),
69 [FLOCK] = KEYMAP(
70 // left hand
71 XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11,
72 XXXXXXX,KC_LBRC,XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,
73 XXXXXXX,S(KC_LBRC),XXXXXXX, XXXXXXX,_______,XXXXXXX,
74 XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,TO(CAPLOCK),XXXXXXX,
75 XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,
76 XXXXXXX,XXXXXXX,
77 XXXXXXX,
78 KC_ESC,XXXXXXX,XXXXXXX,
79 // right hand
80 KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX,
81 XXXXXXX, XXXXXXX, KC_HOME, KC_PGUP, XXXXXXX, KC_RBRC, XXXXXXX,
82 KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, S(KC_RBRC), XXXXXXX,
83 XXXXXXX, XXXXXXX, KC_END, KC_PGDOWN, KC_QUES, KC_SLSH, XXXXXXX,
84 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
85 XXXXXXX, XXXXXXX,
86 XXXXXXX,
87 XXXXXXX, XXXXXXX, XXXXXXX
88 ),
89 [JLOCK] = KEYMAP(
90 // left hand
91 XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11,
92 XXXXXXX,KC_LBRC,KC_GRV, KC_TILD,XXXXXXX,XXXXXXX,XXXXXXX,
93 XXXXXXX,S(KC_LBRC),XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX,
94 XXXXXXX,KC_BSLS,KC_PIPE,XXXXXXX,XXXXXXX,TO(CAPLOCK),XXXXXXX,
95 XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,
96 XXXXXXX,XXXXXXX,
97 XXXXXXX,
98 KC_ESC,XXXXXXX,XXXXXXX,
99 // right hand
100 KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX,
101 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RBRC, XXXXXXX,
102 XXXXXXX, _______, XXXXXXX, XXXXXXX, S(KC_RBRC), XXXXXXX,
103 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
104 XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
105 XXXXXXX, XXXXXXX,
106 XXXXXXX,
107 XXXXXXX, XXXXXXX, XXXXXXX
108 ),
109 [CAPLOCK] = KEYMAP(
110 // left hand
111 TO(BASE), _______, _______, _______, _______, _______, _______,
112 _______, S(KC_Q), S(KC_W), S(KC_E), S(KC_R), S(KC_T), _______,
113 // _______, SFT_T(S(KC_A)), ALT_T(KC_S), CTL_T(KC_D), F(FLOCK), GUI_T(KC_G),
114 _______, S(KC_A), S(KC_S), S(KC_D), S(KC_F), S(KC_G),
115 _______, S(KC_Z), S(KC_X), S(KC_C), S(KC_V), S(KC_B), _______,
116 _______, _______, _______, _______ ,_______,
117 _______, _______,
118 _______,
119 TO(BASE), _______, _______ ,
120
121 // right hand
122 _______, _______, _______, _______, _______, _______, _______,
123 _______, S(KC_Y), S(KC_U), S(KC_I), S(KC_O), S(KC_P), _______,
124 S(KC_H), S(KC_J), S(KC_K), S(KC_L), S(KC_SCLN), _______,
125 _______, S(KC_N), S(KC_M), S(KC_COMM),S(KC_DOT), S(KC_QUOT), _______,
126 _______, _______,_______,_______, _______,
127 _______, _______,
128 _______,
129 _______,_______, TO(BASE)
130 )
131};
132
133const uint16_t PROGMEM fn_actions[] = {
134 [1] = ACTION_LAYER_TAP_KEY(FLOCK,KC_F),
135 [2] = ACTION_LAYER_TAP_KEY(JLOCK,KC_J),
136 [11] = ACTION_LAYER_TAP_KEY(FLOCK,LSFT(KC_F)),
137 [12] = ACTION_LAYER_TAP_KEY(JLOCK,LSFT(KC_J))
138};
139
140const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
141{
142 // MACRODOWN only works in this function
143 switch(id) {
144 case 0:
145 if (record->event.pressed) {
146 SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
147 }
148 break;
149 }
150
151 return MACRO_NONE;
152};
153
154// Runs just one time when the keyboard initializes.
155void matrix_init_user(void) {
156
157};
158
159
160// Runs constantly in the background, in a loop.
161void matrix_scan_user(void) {
162 uint8_t layer = biton32(layer_state);
163
164 switch (layer) {
165 // TODO: Make this relevant to the ErgoDox EZ.
166 case 1:
167 break;
168 case 2:
169 break;
170 default:
171 // none
172 break;
173 }
174};
diff --git a/keyboards/ergodox/keymaps/adam/readme.md b/keyboards/ergodox/keymaps/adam/readme.md
new file mode 100644
index 000000000..9d03df5d5
--- /dev/null
+++ b/keyboards/ergodox/keymaps/adam/readme.md
@@ -0,0 +1,3 @@
1# Adam's ErgoDox
2
3Currently only really uses keys available on Let's Split, for ease of switching
diff --git a/keyboards/ergodox/readme.md b/keyboards/ergodox/readme.md
index 3d6fb455a..90ede90ae 100644
--- a/keyboards/ergodox/readme.md
+++ b/keyboards/ergodox/readme.md
@@ -78,7 +78,6 @@ Linux page]. Some distributions provide a binary, maybe called
78To flash the firmware: 78To flash the firmware:
79 79
80 - Build the firmware with `make keymapname`, for example `make default` 80 - Build the firmware with `make keymapname`, for example `make default`
81
82 - This will result in a hex file called `ergodox_ez_keymapname.hex`, e.g. 81 - This will result in a hex file called `ergodox_ez_keymapname.hex`, e.g.
83 `ergodox_ez_default.hex` 82 `ergodox_ez_default.hex`
84 83
diff --git a/keyboards/lets_split/keymaps/adam/config.h b/keyboards/lets_split/keymaps/adam/config.h
new file mode 100644
index 000000000..177dd22d7
--- /dev/null
+++ b/keyboards/lets_split/keymaps/adam/config.h
@@ -0,0 +1,43 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18
19#define USE_SERIAL
20
21//#define MASTER_LEFT
22// #define MASTER_RIGHT
23#define EE_HANDS
24
25#ifdef SUBPROJECT_rev1
26 #include "../../rev1/config.h"
27#endif
28#ifdef SUBPROJECT_rev2
29 #include "../../rev2/config.h"
30 /* RGB Underglow */
31 #undef RGBLED_NUM
32 #define RGBLIGHT_ANIMATIONS
33 #define RGBLED_NUM 8
34#endif
35#ifdef SUBPROJECT_rev2fliphalf
36 #include "../../rev2fliphalf/config.h"
37#endif
38
39#undef TAPPING_TERM
40#define TAPPING_TERM 200 //At 500 some bad logic takes hold
41#define PREVENT_STUCK_MODIFIERS
42#define IGNORE_MOD_TAP_INTERRUPT
43#define PERMISSIVE_HOLD
diff --git a/keyboards/lets_split/keymaps/adam/keymap.c b/keyboards/lets_split/keymaps/adam/keymap.c
new file mode 100644
index 000000000..8aca73256
--- /dev/null
+++ b/keyboards/lets_split/keymaps/adam/keymap.c
@@ -0,0 +1,79 @@
1#include "lets_split.h"
2#include "action_layer.h"
3#include "eeconfig.h"
4
5extern keymap_config_t keymap_config;
6
7// Each layer gets a name for readability, which is then used in the keymap matrix below.
8// The underscores don't mean anything - you can have a layer called STUFF or any other name.
9// Layer names don't all need to be of the same length, obviously, and you can also skip them
10// entirely and just use numbers.
11#define BASE 0 // default layer
12#define FLOCK 1 // symbols arrows and F keys on F held down
13#define JLOCK 2 // same as Flock but with fall thru J and mapped to J held down
14
15// Fillers to make layering more clear
16#define _______ KC_TRNS
17#define XXXXXXX KC_NO
18
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20
21/* Qwerty
22 * ,-----------------------------------------------------------------------------------.
23 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
24 * |------+------+------+------+------+-------------+------+------+------+------+------|
25 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
26 * |------+------+------+------+------+------|------+------+------+------+------+------|
27 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
28 * |------+------+------+------+------+------+------+------+------+------+------+------|
29 * | Brite| Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Left | Down | Up |Right |
30 * `-----------------------------------------------------------------------------------'
31 */
32[BASE] = KEYMAP ( \
33 TD(1), KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, \
34 KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TAB, KC_TAB, KC_Y, KC_U, KC_I, KC_O, KC_P, \
35 SFT_T(KC_A), ALT_T(KC_S),CTL_T(KC_D), F(FLOCK), GUI_T(KC_G), KC_BSPC, KC_DELETE, GUI_T(KC_H), F(JLOCK), CTL_T(KC_K), ALT_T(KC_L), SFT_T(KC_SCLN), \
36 KC_Z, KC_X, KC_C, KC_V, KC_B, KC_SPC, KC_ENT, KC_N, KC_M, KC_COMM, KC_DOT, KC_QUOTE
37),
38[FLOCK] = KEYMAP ( \
39 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, \
40 KC_LBRC, KC_GRV, KC_TILDE, S(KC_1), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGUP, XXXXXXX, KC_RBRC, \
41 S(KC_LBRC), _______, _______, _______, _______, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, S(KC_RBRC), \
42 KC_BSLS, KC_PIPE, XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, KC_ESC, XXXXXXX, KC_END, KC_PGDOWN, KC_QUES, KC_SLASH \
43),
44[JLOCK] = KEYMAP ( \
45 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, \
46 KC_LBRC, KC_GRV, KC_TILDE, S(KC_1), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGUP, XXXXXXX, KC_RBRC, \
47 S(KC_LBRC), _______, _______, _______, _______, XXXXXXX, XXXXXXX, KC_LEFT, _______, KC_UP, KC_RIGHT, S(KC_RBRC), \
48 KC_BSLS, KC_PIPE, XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, KC_ESC, XXXXXXX, KC_END, KC_PGDOWN, KC_QUES, KC_SLASH \
49)
50};
51
52const uint16_t PROGMEM fn_actions[] = {
53 [FLOCK] = ACTION_LAYER_TAP_KEY(FLOCK,KC_F),
54 [JLOCK] = ACTION_LAYER_TAP_KEY(JLOCK,KC_J)
55};
56#ifdef TAP_DANCE_ENABLE
57void tap_1(qk_tap_dance_state_t *state, void *user_data) {
58 switch (state->count) {
59 case 1:
60 register_code (KC_1);
61 unregister_code (KC_1);
62 break;
63 case 2:
64 register_code (KC_ESC);
65 unregister_code (KC_ESC);
66 break;
67 case 3:
68 register_code (KC_LSFT);
69 register_code (KC_1);
70 unregister_code (KC_1);
71 unregister_code (KC_LSFT);
72 }
73}
74
75qk_tap_dance_action_t tap_dance_actions[] = {
76 [0] = ACTION_TAP_DANCE_DOUBLE(KC_1, KC_ESC),
77 [1] = ACTION_TAP_DANCE_FN(tap_1)
78};
79#endif
diff --git a/keyboards/lets_split/keymaps/adam/makefile b/keyboards/lets_split/keymaps/adam/makefile
new file mode 100644
index 000000000..e5ddcae8d
--- /dev/null
+++ b/keyboards/lets_split/keymaps/adam/makefile
@@ -0,0 +1 @@
TAP_DANCE_ENABLE = yes
diff --git a/tmk_core/common/action_tapping.c b/tmk_core/common/action_tapping.c
index bd9a69ae0..531a3ca34 100644
--- a/tmk_core/common/action_tapping.c
+++ b/tmk_core/common/action_tapping.c
@@ -96,7 +96,7 @@ bool process_tapping(keyrecord_t *keyp)
96 // enqueue 96 // enqueue
97 return false; 97 return false;
98 } 98 }
99#if TAPPING_TERM >= 500 99#if TAPPING_TERM >= 500 || defined PERMISSIVE_HOLD
100 /* Process a key typed within TAPPING_TERM 100 /* Process a key typed within TAPPING_TERM
101 * This can register the key before settlement of tapping, 101 * This can register the key before settlement of tapping,
102 * useful for long TAPPING_TERM but may prevent fast typing. 102 * useful for long TAPPING_TERM but may prevent fast typing.