summaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorZach Richard <Zach.Richard94@gmail.com>2017-12-14 00:20:44 -0500
committerJack Humbert <jack.humb@gmail.com>2017-12-14 00:20:44 -0500
commit8a1e656099a966966e7c81b08d9fb2770e8a61ad (patch)
treeac58f8c2d86982c6d59d09406399315e1a2fb874 /quantum
parent56f266173c0eeaffcfff8ac4becd551585acfdae (diff)
new planck keymap, new feature - hybrid shift/enter action key (great for small keyboards!) (#2100)
* new planck keymap, new feature - hybrid shift/enter action key (great for small keyboards!) * corrected documentation to specify rules.mk file instead of Makefile
Diffstat (limited to 'quantum')
-rw-r--r--quantum/quantum.c23
-rw-r--r--quantum/quantum_keycodes.h3
2 files changed, 26 insertions, 0 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 52f19af98e..c80975f21b 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -162,6 +162,11 @@ void reset_keyboard(void) {
#define RSPC_KEY KC_0
#endif
+// Shift / Enter setup
+#ifndef SFTENT_KEY
+ #define SFTENT_KEY KC_ENT
+#endif
+
static bool shift_interrupted[2] = {0, 0};
static uint16_t scs_timer[2] = {0, 0};
@@ -552,6 +557,24 @@ bool process_record_quantum(keyrecord_t *record) {
}
return false;
}
+
+ case KC_SFTENT: {
+ if (record->event.pressed) {
+ shift_interrupted[1] = false;
+ scs_timer[1] = timer_read ();
+ register_mods(MOD_BIT(KC_RSFT));
+ }
+ else if (!shift_interrupted[1] && timer_elapsed(scs_timer[1]) < TAPPING_TERM) {
+ unregister_mods(MOD_BIT(KC_RSFT));
+ register_code(SFTENT_KEY);
+ unregister_code(SFTENT_KEY);
+ }
+ else {
+ unregister_mods(MOD_BIT(KC_RSFT));
+ }
+ return false;
+ }
+
case GRAVE_ESC: {
uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)
|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)));
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h
index f2cb257188..453774d85c 100644
--- a/quantum/quantum_keycodes.h
+++ b/quantum/quantum_keycodes.h
@@ -423,6 +423,9 @@ enum quantum_keycodes {
// Right shift, close paren
KC_RSPC,
+ // Shift, Enter
+ KC_SFTENT,
+
// Printing
PRINT_ON,
PRINT_OFF,