diff options
| author | Zach Richard <Zach.Richard94@gmail.com> | 2017-12-14 00:20:44 -0500 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2017-12-14 00:20:44 -0500 |
| commit | 8a1e656099a966966e7c81b08d9fb2770e8a61ad (patch) | |
| tree | ac58f8c2d86982c6d59d09406399315e1a2fb874 /quantum | |
| parent | 56f266173c0eeaffcfff8ac4becd551585acfdae (diff) | |
| download | qmk_firmware-8a1e656099a966966e7c81b08d9fb2770e8a61ad.tar.gz qmk_firmware-8a1e656099a966966e7c81b08d9fb2770e8a61ad.zip | |
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.c | 23 | ||||
| -rw-r--r-- | quantum/quantum_keycodes.h | 3 |
2 files changed, 26 insertions, 0 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index 52f19af98..c80975f21 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
| @@ -162,6 +162,11 @@ void reset_keyboard(void) { | |||
| 162 | #define RSPC_KEY KC_0 | 162 | #define RSPC_KEY KC_0 |
| 163 | #endif | 163 | #endif |
| 164 | 164 | ||
| 165 | // Shift / Enter setup | ||
| 166 | #ifndef SFTENT_KEY | ||
| 167 | #define SFTENT_KEY KC_ENT | ||
| 168 | #endif | ||
| 169 | |||
| 165 | static bool shift_interrupted[2] = {0, 0}; | 170 | static bool shift_interrupted[2] = {0, 0}; |
| 166 | static uint16_t scs_timer[2] = {0, 0}; | 171 | static uint16_t scs_timer[2] = {0, 0}; |
| 167 | 172 | ||
| @@ -552,6 +557,24 @@ bool process_record_quantum(keyrecord_t *record) { | |||
| 552 | } | 557 | } |
| 553 | return false; | 558 | return false; |
| 554 | } | 559 | } |
| 560 | |||
| 561 | case KC_SFTENT: { | ||
| 562 | if (record->event.pressed) { | ||
| 563 | shift_interrupted[1] = false; | ||
| 564 | scs_timer[1] = timer_read (); | ||
| 565 | register_mods(MOD_BIT(KC_RSFT)); | ||
| 566 | } | ||
| 567 | else if (!shift_interrupted[1] && timer_elapsed(scs_timer[1]) < TAPPING_TERM) { | ||
| 568 | unregister_mods(MOD_BIT(KC_RSFT)); | ||
| 569 | register_code(SFTENT_KEY); | ||
| 570 | unregister_code(SFTENT_KEY); | ||
| 571 | } | ||
| 572 | else { | ||
| 573 | unregister_mods(MOD_BIT(KC_RSFT)); | ||
| 574 | } | ||
| 575 | return false; | ||
| 576 | } | ||
| 577 | |||
| 555 | case GRAVE_ESC: { | 578 | case GRAVE_ESC: { |
| 556 | uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT) | 579 | uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT) |
| 557 | |MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))); | 580 | |MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))); |
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index f2cb25718..453774d85 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h | |||
| @@ -423,6 +423,9 @@ enum quantum_keycodes { | |||
| 423 | // Right shift, close paren | 423 | // Right shift, close paren |
| 424 | KC_RSPC, | 424 | KC_RSPC, |
| 425 | 425 | ||
| 426 | // Shift, Enter | ||
| 427 | KC_SFTENT, | ||
| 428 | |||
| 426 | // Printing | 429 | // Printing |
| 427 | PRINT_ON, | 430 | PRINT_ON, |
| 428 | PRINT_OFF, | 431 | PRINT_OFF, |
