aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXScorpion2 <rcalt2vt@gmail.com>2019-05-19 11:15:50 -0500
committerDrashna Jaelre <drashna@live.com>2019-05-19 09:15:50 -0700
commita0d6c5a1136e2c56aa4a57eac08355c2b5d79ad5 (patch)
treeb948914987ef9b4692c9727fa421b4b62e0ada8d
parentf11fde9bf5898a09201042d612caaff8d4692bb9 (diff)
downloadqmk_firmware-a0d6c5a1136e2c56aa4a57eac08355c2b5d79ad5.tar.gz
qmk_firmware-a0d6c5a1136e2c56aa4a57eac08355c2b5d79ad5.zip
[Keymap] Update Xulkal user code (#5920)
-rw-r--r--users/xulkal/config.h10
-rw-r--r--users/xulkal/process_records.c56
-rw-r--r--users/xulkal/process_records.h18
3 files changed, 20 insertions, 64 deletions
diff --git a/users/xulkal/config.h b/users/xulkal/config.h
index ecd01f794..c794530d4 100644
--- a/users/xulkal/config.h
+++ b/users/xulkal/config.h
@@ -5,6 +5,7 @@
5#undef TAPPING_TERM 5#undef TAPPING_TERM
6#define TAPPING_TERM 175 6#define TAPPING_TERM 175
7 7
8#define SPACE_CADET_MODIFIER_CARRYOVER
8#define LSPO_KEYS KC_LSFT, KC_TRNS, KC_LBRC 9#define LSPO_KEYS KC_LSFT, KC_TRNS, KC_LBRC
9#define RSPC_KEYS KC_RSFT, KC_TRNS, KC_RBRC 10#define RSPC_KEYS KC_RSFT, KC_TRNS, KC_RBRC
10#define LCPO_KEYS KC_LCTL, KC_TRNS, KC_MINS 11#define LCPO_KEYS KC_LCTL, KC_TRNS, KC_MINS
@@ -27,12 +28,3 @@
27#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS 28#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
28#define DISABLE_RGB_MATRIX_SPLASH 29#define DISABLE_RGB_MATRIX_SPLASH
29#define DISABLE_RGB_MATRIX_SOLID_SPLASH 30#define DISABLE_RGB_MATRIX_SOLID_SPLASH
30
31// Don't like or feel to identical to other effects
32#if defined(__AVR__)
33#define DISABLE_RGB_MATRIX_RAINBOW_BEACON
34#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
35#define DISABLE_RGB_MATRIX_DIGITAL_RAIN
36#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
37#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
38#endif
diff --git a/users/xulkal/process_records.c b/users/xulkal/process_records.c
index 7c2b5e133..5ba59965f 100644
--- a/users/xulkal/process_records.c
+++ b/users/xulkal/process_records.c
@@ -15,47 +15,15 @@ qk_tap_dance_action_t tap_dance_actions[] = {
15extern void eeconfig_update_rgb_matrix_default(void); 15extern void eeconfig_update_rgb_matrix_default(void);
16#endif 16#endif
17 17
18#ifdef TRILAYER_ENABLED
19uint32_t layer_state_set_user(uint32_t state) {
20 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
21}
22#endif
23
18bool process_record_user(uint16_t keycode, keyrecord_t *record) { 24bool process_record_user(uint16_t keycode, keyrecord_t *record) {
19 static uint16_t reset_timer; 25 static uint16_t reset_timer;
20 switch (keycode) { 26 switch (keycode) {
21 case QWERTY:
22 if (record->event.pressed) {
23 set_single_persistent_default_layer(_QWERTY);
24 }
25 return false;
26 case GAME:
27#ifndef GAMELAYER_DISABLE
28 if (record->event.pressed) {
29 set_single_persistent_default_layer(_GAME);
30 }
31#endif
32 return false;
33 case LOWER:
34 if (record->event.pressed) {
35 layer_on(_LOWER);
36#ifdef TRILAYER_ENABLED
37 update_tri_layer(_LOWER, _RAISE, _ADJUST);
38#endif
39 } else {
40 layer_off(_LOWER);
41#ifdef TRILAYER_ENABLED
42 update_tri_layer(_LOWER, _RAISE, _ADJUST);
43#endif
44 }
45 return false;
46 case RAISE:
47 if (record->event.pressed) {
48 layer_on(_RAISE);
49#ifdef TRILAYER_ENABLED
50 update_tri_layer(_LOWER, _RAISE, _ADJUST);
51#endif
52 } else {
53 layer_off(_RAISE);
54#ifdef TRILAYER_ENABLED
55 update_tri_layer(_LOWER, _RAISE, _ADJUST);
56#endif
57 }
58 return false;
59 case RGBRST: 27 case RGBRST:
60#if defined(RGBLIGHT_ENABLE) 28#if defined(RGBLIGHT_ENABLE)
61 if (record->event.pressed) { 29 if (record->event.pressed) {
@@ -79,20 +47,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
79 return false; 47 return false;
80 } 48 }
81 49
82 return process_record_keymap(keycode, record) && 50 return process_record_keymap(keycode, record);
83#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
84 process_record_rgb(keycode, record) &&
85#endif // RGBLIGHT_ENABLE;
86 true;
87} 51}
88 52
89__attribute__ ((weak)) 53__attribute__ ((weak))
90bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { 54bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
91 return true; 55 return true;
92} 56}
93
94
95__attribute__ ((weak))
96bool process_record_rgb(uint16_t keycode, keyrecord_t *record) {
97 return true;
98}
diff --git a/users/xulkal/process_records.h b/users/xulkal/process_records.h
index d79ab7e32..8a195df5c 100644
--- a/users/xulkal/process_records.h
+++ b/users/xulkal/process_records.h
@@ -4,6 +4,17 @@
4#define RIS_ESC LT(_RAISE, KC_ESC) 4#define RIS_ESC LT(_RAISE, KC_ESC)
5#define RIS_CAPS LT(_RAISE, KC_CAPS) 5#define RIS_CAPS LT(_RAISE, KC_CAPS)
6 6
7#define QWERTY DF(_QWERTY)
8
9#ifndef GAMELAYER_DISABLE
10#define GAME DF(_GAME)
11#else
12#define GAME KC_TRANSPARENT
13#endif
14
15#define LOWER MO(_LOWER)
16#define RAISE MO(_RAISE)
17
7#ifdef TAP_DANCE_ENABLE 18#ifdef TAP_DANCE_ENABLE
8#include "process_tap_dance.h" 19#include "process_tap_dance.h"
9 20
@@ -42,12 +53,7 @@ enum layer_number {
42}; 53};
43 54
44enum custom_keycodes { 55enum custom_keycodes {
45 QWERTY = SAFE_RANGE, 56 RGBRST = SAFE_RANGE
46 GAME,
47 LOWER,
48 RAISE,
49 RGBRST
50}; 57};
51 58
52bool process_record_keymap(uint16_t keycode, keyrecord_t *record); 59bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
53bool process_record_rgb(uint16_t keycode, keyrecord_t *record);