Merge pull request #1359 from agbell/PR

Permissive Hold, and two keymaps
daktil_thumb_popravljen
Jack Humbert 2017-06-07 18:47:29 -04:00 committed by GitHub
commit 84012d8243
9 changed files with 310 additions and 3 deletions

View File

@ -15,6 +15,8 @@ RUN apt-get update && apt-get install --no-install-recommends -y build-essential
binutils-arm-none-eabi \ binutils-arm-none-eabi \
libnewlib-arm-none-eabi \ libnewlib-arm-none-eabi \
git \ git \
software-properties-common \
avrdude \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
ENV keyboard=ergodox ENV keyboard=ergodox
@ -23,4 +25,4 @@ ENV keymap=default
VOLUME /qmk VOLUME /qmk
WORKDIR /qmk WORKDIR /qmk
CMD make clean ; make keyboard=${keyboard} subproject=${subproject} keymap=${keymap} CMD make clean; make;

View File

@ -0,0 +1,6 @@
#include "../../config.h"
#undef TAPPING_TERM
#define TAPPING_TERM 300 //At 500 some bad logic takes hold
#define PREVENT_STUCK_MODIFIERS
#define IGNORE_MOD_TAP_INTERRUPT

View File

@ -0,0 +1,174 @@
#include "ergodox.h"
#include "debug.h"
#include "action_layer.h"
#include "version.h"
#define BASE 0 // default layer
#define FLOCK 1 // symbols arrows and F keys on F held down
#define JLOCK 2 // same as Flock but with fall thru J and mapped to J held down
#define CAPLOCK 3 //caps on until space / enter / esc
#define SFLOCK 11 // symbols arrows and F keys on F held down
#define SJLOCK 12 // same as Flock but with fall thru J and mapped to J held down
#define _______ KC_TRNS
#define XXXXXXX KC_NO
// Sends macro when key is tapped, presses mod when key is held
#define tap_mod_macro(record, mod, macro) ( ((record)->event.pressed) ? \
( ((record)->tap.count <= 0 || (record)->tap.interrupted) ? MACRO(D(mod), END) : MACRO_NONE ) : \
( ((record)->tap.count > 0 && !((record)->tap.interrupted)) ? (macro) : MACRO(U(mod), END) ) )
#define tap_mod_shift(record, mod, macro) ( ((record)->event.pressed) ? \
( ((record)->tap.count <= 0 || (record)->tap.interrupted) ? MACRO(D(mod), END) : MACRO_NONE ) : \
( ((record)->tap.count > 0 && !((record)->tap.interrupted)) ? (MACRO( D(LSFT), T(LBRC), U(LSFT), END)) : MACRO(U(mod), END) ) )
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Layout
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | Q | W | E | R | T | | | | Y | U | I | O | P | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | A | S | D | F | G |------| |------| H | J | K | L |; | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | Z | X | C | V | B | | | | N | M | , | . | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+--------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `----------------------'
*/
[BASE] = KEYMAP(
// left hand
GUI_T(KC_ESC), KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS,
_______, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TAB,
_______, SFT_T(KC_A), ALT_T(KC_S), CTL_T(KC_D), F(FLOCK), GUI_T(KC_G),
_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC,
_______, _______, _______, _______ ,_______,
_______, _______,
_______,
KC_SPC, _______, _______ ,
// right hand
KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
KC_TAB, KC_Y, KC_U, KC_I, KC_O, KC_P, _______,
GUI_T(KC_H), F(JLOCK), CTL_T(KC_K), ALT_T(KC_L), SFT_T(KC_SCLN), _______,
KC_DELETE, KC_N, KC_M, KC_COMM,KC_DOT, KC_QUOT, _______,
_______, _______,_______,_______, _______,
_______, _______,
_______,
_______,_______, KC_ENT
),
[FLOCK] = KEYMAP(
// left hand
XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11,
XXXXXXX,KC_LBRC,XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,
XXXXXXX,S(KC_LBRC),XXXXXXX, XXXXXXX,_______,XXXXXXX,
XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,TO(CAPLOCK),XXXXXXX,
XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,
XXXXXXX,XXXXXXX,
XXXXXXX,
KC_ESC,XXXXXXX,XXXXXXX,
// right hand
KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX,
XXXXXXX, XXXXXXX, KC_HOME, KC_PGUP, XXXXXXX, KC_RBRC, XXXXXXX,
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, S(KC_RBRC), XXXXXXX,
XXXXXXX, XXXXXXX, KC_END, KC_PGDOWN, KC_QUES, KC_SLSH, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX,
XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX
),
[JLOCK] = KEYMAP(
// left hand
XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11,
XXXXXXX,KC_LBRC,KC_GRV, KC_TILD,XXXXXXX,XXXXXXX,XXXXXXX,
XXXXXXX,S(KC_LBRC),XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX,
XXXXXXX,KC_BSLS,KC_PIPE,XXXXXXX,XXXXXXX,TO(CAPLOCK),XXXXXXX,
XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,
XXXXXXX,XXXXXXX,
XXXXXXX,
KC_ESC,XXXXXXX,XXXXXXX,
// right hand
KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RBRC, XXXXXXX,
XXXXXXX, _______, XXXXXXX, XXXXXXX, S(KC_RBRC), XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX,
XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX
),
[CAPLOCK] = KEYMAP(
// left hand
TO(BASE), _______, _______, _______, _______, _______, _______,
_______, S(KC_Q), S(KC_W), S(KC_E), S(KC_R), S(KC_T), _______,
// _______, SFT_T(S(KC_A)), ALT_T(KC_S), CTL_T(KC_D), F(FLOCK), GUI_T(KC_G),
_______, S(KC_A), S(KC_S), S(KC_D), S(KC_F), S(KC_G),
_______, S(KC_Z), S(KC_X), S(KC_C), S(KC_V), S(KC_B), _______,
_______, _______, _______, _______ ,_______,
_______, _______,
_______,
TO(BASE), _______, _______ ,
// right hand
_______, _______, _______, _______, _______, _______, _______,
_______, S(KC_Y), S(KC_U), S(KC_I), S(KC_O), S(KC_P), _______,
S(KC_H), S(KC_J), S(KC_K), S(KC_L), S(KC_SCLN), _______,
_______, S(KC_N), S(KC_M), S(KC_COMM),S(KC_DOT), S(KC_QUOT), _______,
_______, _______,_______,_______, _______,
_______, _______,
_______,
_______,_______, TO(BASE)
)
};
const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_LAYER_TAP_KEY(FLOCK,KC_F),
[2] = ACTION_LAYER_TAP_KEY(JLOCK,KC_J),
[11] = ACTION_LAYER_TAP_KEY(FLOCK,LSFT(KC_F)),
[12] = ACTION_LAYER_TAP_KEY(JLOCK,LSFT(KC_J))
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
case 0:
if (record->event.pressed) {
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
}
break;
}
return MACRO_NONE;
};
// Runs just one time when the keyboard initializes.
void matrix_init_user(void) {
};
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
uint8_t layer = biton32(layer_state);
switch (layer) {
// TODO: Make this relevant to the ErgoDox EZ.
case 1:
break;
case 2:
break;
default:
// none
break;
}
};

View File

@ -0,0 +1,3 @@
# Adam's ErgoDox
Currently only really uses keys available on Let's Split, for ease of switching

View File

@ -78,7 +78,6 @@ Linux page]. Some distributions provide a binary, maybe called
To flash the firmware: To flash the firmware:
- Build the firmware with `make keymapname`, for example `make default` - Build the firmware with `make keymapname`, for example `make default`
- This will result in a hex file called `ergodox_ez_keymapname.hex`, e.g. - This will result in a hex file called `ergodox_ez_keymapname.hex`, e.g.
`ergodox_ez_default.hex` `ergodox_ez_default.hex`

View File

@ -0,0 +1,43 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define USE_SERIAL
//#define MASTER_LEFT
// #define MASTER_RIGHT
#define EE_HANDS
#ifdef SUBPROJECT_rev1
#include "../../rev1/config.h"
#endif
#ifdef SUBPROJECT_rev2
#include "../../rev2/config.h"
/* RGB Underglow */
#undef RGBLED_NUM
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 8
#endif
#ifdef SUBPROJECT_rev2fliphalf
#include "../../rev2fliphalf/config.h"
#endif
#undef TAPPING_TERM
#define TAPPING_TERM 200 //At 500 some bad logic takes hold
#define PREVENT_STUCK_MODIFIERS
#define IGNORE_MOD_TAP_INTERRUPT
#define PERMISSIVE_HOLD

View File

@ -0,0 +1,79 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define BASE 0 // default layer
#define FLOCK 1 // symbols arrows and F keys on F held down
#define JLOCK 2 // same as Flock but with fall thru J and mapped to J held down
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[BASE] = KEYMAP ( \
TD(1), KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, \
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TAB, KC_TAB, KC_Y, KC_U, KC_I, KC_O, KC_P, \
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), \
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_SPC, KC_ENT, KC_N, KC_M, KC_COMM, KC_DOT, KC_QUOTE
),
[FLOCK] = KEYMAP ( \
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, \
KC_LBRC, KC_GRV, KC_TILDE, S(KC_1), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGUP, XXXXXXX, KC_RBRC, \
S(KC_LBRC), _______, _______, _______, _______, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, S(KC_RBRC), \
KC_BSLS, KC_PIPE, XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, KC_ESC, XXXXXXX, KC_END, KC_PGDOWN, KC_QUES, KC_SLASH \
),
[JLOCK] = KEYMAP ( \
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, \
KC_LBRC, KC_GRV, KC_TILDE, S(KC_1), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGUP, XXXXXXX, KC_RBRC, \
S(KC_LBRC), _______, _______, _______, _______, XXXXXXX, XXXXXXX, KC_LEFT, _______, KC_UP, KC_RIGHT, S(KC_RBRC), \
KC_BSLS, KC_PIPE, XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, KC_ESC, XXXXXXX, KC_END, KC_PGDOWN, KC_QUES, KC_SLASH \
)
};
const uint16_t PROGMEM fn_actions[] = {
[FLOCK] = ACTION_LAYER_TAP_KEY(FLOCK,KC_F),
[JLOCK] = ACTION_LAYER_TAP_KEY(JLOCK,KC_J)
};
#ifdef TAP_DANCE_ENABLE
void tap_1(qk_tap_dance_state_t *state, void *user_data) {
switch (state->count) {
case 1:
register_code (KC_1);
unregister_code (KC_1);
break;
case 2:
register_code (KC_ESC);
unregister_code (KC_ESC);
break;
case 3:
register_code (KC_LSFT);
register_code (KC_1);
unregister_code (KC_1);
unregister_code (KC_LSFT);
}
}
qk_tap_dance_action_t tap_dance_actions[] = {
[0] = ACTION_TAP_DANCE_DOUBLE(KC_1, KC_ESC),
[1] = ACTION_TAP_DANCE_FN(tap_1)
};
#endif

View File

@ -0,0 +1 @@
TAP_DANCE_ENABLE = yes

View File

@ -96,7 +96,7 @@ bool process_tapping(keyrecord_t *keyp)
// enqueue // enqueue
return false; return false;
} }
#if TAPPING_TERM >= 500 #if TAPPING_TERM >= 500 || defined PERMISSIVE_HOLD
/* Process a key typed within TAPPING_TERM /* Process a key typed within TAPPING_TERM
* This can register the key before settlement of tapping, * This can register the key before settlement of tapping,
* useful for long TAPPING_TERM but may prevent fast typing. * useful for long TAPPING_TERM but may prevent fast typing.