forked from qmk/qmk_userspace
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear some crap code into seperate c files
- Loading branch information
Showing
5 changed files
with
177 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
bool is_alt_tab_active = false; | ||
uint16_t alt_tab_timer = 0; | ||
|
||
#ifndef PLODAH_ALT_TAB_DELAY | ||
# define PLODAH_ALT_TAB_DELAY 1000 | ||
#endif //PLODAH_ALT_TAB_DELAY | ||
|
||
void alt_tab_fw(void) { | ||
if (!is_alt_tab_active) { | ||
is_alt_tab_active = true; | ||
register_code(KC_LALT); | ||
} | ||
alt_tab_timer = timer_read(); | ||
tap_code16(KC_TAB); | ||
} | ||
void alt_tab_bk(void) { | ||
if (!is_alt_tab_active) { | ||
is_alt_tab_active = true; | ||
register_code(KC_LALT); | ||
} | ||
alt_tab_timer = timer_read(); | ||
tap_code16(S(KC_TAB)); | ||
} | ||
void plodah_alttab_check(void) { | ||
if (is_alt_tab_active) { | ||
if (timer_elapsed(alt_tab_timer) > PLODAH_ALT_TAB_DELAY) { | ||
unregister_code(KC_LALT); | ||
is_alt_tab_active = false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
bool is_autocorrect_indicator_active = false; | ||
uint16_t autocorrect_indicator_timer = 0; | ||
|
||
#ifndef PLODAH_AUTOCORRECT_INDICATOR_DURATION | ||
# define PLODAH_AUTOCORRECT_INDICATOR_DURATION 600 | ||
#endif //PLODAH_AUTOCORRECT_INDICATOR_DURATION | ||
|
||
#ifndef PLODAH_AUTOCORRECT_INDICATOR_COLOUR | ||
# define PLODAH_AUTOCORRECT_INDICATOR_COLOUR HSV_RED | ||
#endif //PLODAH_AUTOCORRECT_INDICATOR_COLOUR | ||
|
||
void plodah_autocorrect_indicator_start(void) { | ||
if (!is_autocorrect_indicator_active) { | ||
is_autocorrect_indicator_active = true; | ||
HSV curhsv = rgb_matrix_get_hsv(); | ||
HSV indhsv = { PLODAH_AUTOCORRECT_INDICATOR_COLOUR }; | ||
rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); | ||
rgb_matrix_sethsv_noeeprom(indhsv.h, indhsv.s, curhsv.v); | ||
} | ||
autocorrect_indicator_timer = timer_read(); | ||
} | ||
|
||
void plodah_autocorrect_indicator_check(void) { | ||
if (is_autocorrect_indicator_active) { | ||
if (timer_elapsed(autocorrect_indicator_timer) > PLODAH_AUTOCORRECT_INDICATOR_DURATION) { | ||
rgb_matrix_reload_from_eeprom(); | ||
is_autocorrect_indicator_active = false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
#pragma once | ||
|
||
void rage_quit_fin_act(int count){ | ||
if (count >= 5) { | ||
if(IS_LAYER_ON(PLODAH_BORING_LAYER)) { | ||
SEND_STRING("Cool."); | ||
layer_move(0); | ||
} | ||
else { | ||
SEND_STRING("I'm sorry!"); | ||
layer_move(PLODAH_BORING_LAYER); | ||
} | ||
void rage_quit_fin(tap_dance_state_t *state, void *user_data){ | ||
if(state->count >= 5){ | ||
if(IS_LAYER_ON(PLODAH_BORING_LAYER)){ | ||
SEND_STRING("Cool."); | ||
layer_move(0); | ||
} | ||
else{ | ||
if(count >= 3) { | ||
SEND_STRING("Nearies"); | ||
} | ||
else{ | ||
register_code(KC_ESC); | ||
} | ||
SEND_STRING("I'm sorry!"); | ||
layer_move(PLODAH_BORING_LAYER); | ||
} | ||
} | ||
void rage_quit_rst_act(int count){ | ||
if(count < 3) { | ||
unregister_code(KC_ESC); | ||
} | ||
else{ | ||
if(state->count >= 3){ | ||
SEND_STRING("Nearies"); | ||
} | ||
} | ||
else{ | ||
register_code(KC_ESC); | ||
} | ||
} | ||
}; | ||
|
||
void rage_quit_rst(tap_dance_state_t *state, void *user_data){ | ||
if(state->count < 3){ | ||
unregister_code(KC_ESC); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters