From 704a2e8d3c0bd15f6c8accd5a39fb88ca6c9e2d5 Mon Sep 17 00:00:00 2001 From: SpacebarRacecar <42380065+SpacebarRacecar@users.noreply.github.com> Date: Mon, 22 Oct 2018 22:23:22 +0200 Subject: Keymap: Updates to personal userspace and keymaps (#4206) * - updated personal userspace - updated fc660c, niu mini and planck keymaps - added prime_o keymap * Rename README.md to readme.md --- users/spacebarracecar/spacebarracecar.c | 47 +++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 5 deletions(-) (limited to 'users/spacebarracecar/spacebarracecar.c') diff --git a/users/spacebarracecar/spacebarracecar.c b/users/spacebarracecar/spacebarracecar.c index 404331f8df..f7048869ed 100644 --- a/users/spacebarracecar/spacebarracecar.c +++ b/users/spacebarracecar/spacebarracecar.c @@ -1,18 +1,29 @@ #include "spacebarracecar.h" #ifdef GERMAN_ENABLE +// These indicate if left and right shift are physically pressed bool lshift = false; bool rshift = false; + +// Interrupt and times for space cadet shift bool lshiftp = false; bool rshiftp = false; uint16_t lshift_timer = 0; uint16_t rshift_timer = 0; +// Number of items that are saved in prev_kcs uint8_t prev_indx = 0; +// Used to save the last 6 actual keycodes activated by frankenkeycodes uint16_t prev_kcs[6] = {0, 0, 0, 0, 0, 0}; +// If true the deadkey characters grave and circonflexe are not automatically escaped bool esct = false; +/* +Used to add a keycode to a prev_kcs to remember it. +When full the last code gets discarded and replaced by +the new one. +*/ void add_to_prev(uint16_t kc){ for (int i=0; ievent.pressed) { + timer_timeout(); game = !game; } - return false; + // allows keymap to execute further commands when CU_GAME is pressed, for example enabling a macro layer + return process_record_keymap(keycode, record) && false; case KC_LGUI: case KC_RGUI: + if (record->event.pressed) + timer_timeout(); if (game) return false; else @@ -77,11 +102,21 @@ bool process_record_userspace(uint16_t keycode, keyrecord_t *record) { } layer_off(_NAV); } - return false; + return false; + case KC_P00: + if(record->event.pressed) { + timer_timeout(); + register_code(KC_P0); + unregister_code(KC_P0); + register_code(KC_P0); + unregister_code(KC_P0); + } + return false; #ifdef RGBLIGHT_ENABLE case CU_RGBV: if(record->event.pressed) { + timer_timeout(); if (rgblight_get_val()+32>255) rgblight_sethsv(rgblight_get_hue(), rgblight_get_sat(), 31); else @@ -133,6 +168,7 @@ bool process_record_userspace(uint16_t keycode, keyrecord_t *record) { return false; case CU_ESCT: if(record->event.pressed) { + timer_timeout(); esct = !esct; } return false; @@ -282,6 +318,7 @@ bool process_record_userspace(uint16_t keycode, keyrecord_t *record) { case KC_LCTL: case KC_RCTL: if(!record->event.pressed) { + timer_timeout(); unregister_code(KC_Z); unregister_code(KC_Y); } @@ -300,6 +337,6 @@ bool process_record_userspace(uint16_t keycode, keyrecord_t *record) { #endif } - return true; + return process_record_keymap(keycode, record); } } -- cgit v1.2.3