diff --git a/keyboards/bastardkb/skeletyl/keymaps/quotengrote/config.h b/keyboards/bastardkb/skeletyl/keymaps/quotengrote/config.h index 2a93aea25d..0b141a0755 100644 --- a/keyboards/bastardkb/skeletyl/keymaps/quotengrote/config.h +++ b/keyboards/bastardkb/skeletyl/keymaps/quotengrote/config.h @@ -15,6 +15,5 @@ #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 #define SPLIT_LAYER_STATE_ENABLE // for layer indicators #define RGB_TRIGGER_ON_KEYDOWN // Triggers RGB keypress events on key down. This makes RGB control feel more responsive. This may cause RGB to not function properly on some boards -// rgb timeout; https://gist.github.com/aashreys/01cb34605a290a7cfb94a856bdabc94c -#define RGBLIGHT_SLEEP // allows us to use rgblight_suspend() and rgblight_wakeup() in keymap.c -#define RGBLIGHT_TIMEOUT 10000 // 10 seconds +// rgb timeout; https://gist.github.com/aashreys/01cb34605a290a7cfb94a856bdabc94c?permalink_comment_id=4520204#gistcomment-4520204 +#define RGB_MATRIX_TIMEOUT 0 // number of milliseconds to wait until rgb automatically turns off diff --git a/keyboards/bastardkb/skeletyl/keymaps/quotengrote/keymap.c b/keyboards/bastardkb/skeletyl/keymaps/quotengrote/keymap.c index aef18bc570..7c29a58e01 100644 --- a/keyboards/bastardkb/skeletyl/keymaps/quotengrote/keymap.c +++ b/keyboards/bastardkb/skeletyl/keymaps/quotengrote/keymap.c @@ -162,47 +162,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return true; } - -// rgb timeout; https://gist.github.com/aashreys/01cb34605a290a7cfb94a856bdabc94c -static uint16_t key_timer; // timer to track the last keyboard activity -static void refresh_rgb(void); // refreshes the activity timer and RGB, invoke whenever activity happens -static void check_rgb_timeout(void); // checks if enough time has passed for RGB to timeout -bool is_rgb_timeout = false; // store if RGB has timed out or not in a boolean - -void refresh_rgb() { - key_timer = timer_read(); // store time of last refresh - if (is_rgb_timeout) { // only do something if rgb has timed out - print("Activity detected, removing timeout\n"); - is_rgb_timeout = false; - rgb_matrix_enable_noeeprom(); - } -} - -void check_rgb_timeout() { - if (!is_rgb_timeout && timer_elapsed(key_timer) > RGBLIGHT_TIMEOUT) { - rgb_matrix_disable_noeeprom(); - is_rgb_timeout = true; - } -} -/* Then, call the above functions from QMK's built in post processing functions like so */ -/* Runs at the end of each scan loop, check if RGB timeout has occured */ -void housekeeping_task_user(void) { - #ifdef RGBLIGHT_TIMEOUT - check_rgb_timeout(); - #endif - /* rest of the function code here */ -} -/* Runs after each key press, check if activity occurred */ -void post_process_record_user(uint16_t keycode, keyrecord_t *record) { - #ifdef RGBLIGHT_TIMEOUT - if (record->event.pressed) refresh_rgb(); - #endif - /* rest of the function code here */ -} -/* Runs after each encoder tick, check if activity occurred */ -void post_encoder_update_user(uint8_t index, bool clockwise) { - #ifdef RGBLIGHT_TIMEOUT - refresh_rgb(); - #endif - /* rest of the function code here */ -}