summaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-11-22 02:17:45 +0100
committerJack Humbert <jack.humb@gmail.com>2016-11-22 02:17:45 +0100
commit450a8fb5b61de8166fe21eb4f57e1c00514afe32 (patch)
treec7d363a244115eb3736401cc6670f1967ddf9a5d /quantum
parent06a2677b7eedbf58532fa1a673ba1277e756174d (diff)
parentaf119baf710c0b19cfe3351e3f3e89ddeeaacdf6 (diff)
downloadqmk_firmware-450a8fb5b61de8166fe21eb4f57e1c00514afe32.tar.gz
qmk_firmware-450a8fb5b61de8166fe21eb4f57e1c00514afe32.tar.xz
Merge branch 'master' of github.com:jackhumbert/qmk_firmware into wu5y7
Diffstat (limited to 'quantum')
-rw-r--r--quantum/quantum.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 8b2fefef6..f9f1ef22d 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -1,5 +1,9 @@
#include "quantum.h"
+#ifndef TAPPING_TERM
+#define TAPPING_TERM 200
+#endif
+
static void do_code16 (uint16_t code, void (*f) (uint8_t)) {
switch (code) {
case QK_MODS ... QK_MODS_MAX:
@@ -75,6 +79,7 @@ void reset_keyboard(void) {
#endif
static bool shift_interrupted[2] = {0, 0};
+static uint16_t scs_timer = 0;
bool process_record_quantum(keyrecord_t *record) {
@@ -286,6 +291,7 @@ bool process_record_quantum(keyrecord_t *record) {
case KC_LSPO: {
if (record->event.pressed) {
shift_interrupted[0] = false;
+ scs_timer = timer_read ();
register_mods(MOD_BIT(KC_LSFT));
}
else {
@@ -295,7 +301,7 @@ bool process_record_quantum(keyrecord_t *record) {
shift_interrupted[1] = true;
}
#endif
- if (!shift_interrupted[0]) {
+ if (!shift_interrupted[0] && timer_elapsed(scs_timer) < TAPPING_TERM) {
register_code(LSPO_KEY);
unregister_code(LSPO_KEY);
}
@@ -308,6 +314,7 @@ bool process_record_quantum(keyrecord_t *record) {
case KC_RSPC: {
if (record->event.pressed) {
shift_interrupted[1] = false;
+ scs_timer = timer_read ();
register_mods(MOD_BIT(KC_RSFT));
}
else {
@@ -317,7 +324,7 @@ bool process_record_quantum(keyrecord_t *record) {
shift_interrupted[1] = true;
}
#endif
- if (!shift_interrupted[1]) {
+ if (!shift_interrupted[1] && timer_elapsed(scs_timer) < TAPPING_TERM) {
register_code(RSPC_KEY);
unregister_code(RSPC_KEY);
}