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.
Add a typing indicator for some reason
- Loading branch information
Showing
4 changed files
with
46 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
bool plodah_typingindicator_active = false; | ||
uint16_t plodah_typingindicator_timer = 0; | ||
|
||
#ifndef PLODAH_TYPINGINDICATOR_RGBCOLOR | ||
# define PLODAH_TYPINGINDICATOR_RGBCOLOR RGB_RED | ||
#endif //PLODAH_TYPINGINDICATOR_RGBCOLOR | ||
|
||
#ifndef PLODAH_TYPINGINDICATOR_DURATION | ||
# define PLODAH_TYPINGINDICATOR_DURATION 1000 | ||
#endif //PLODAH_TYPINGINDICATOR_DURATION | ||
|
||
void plodah_typingindicator_start(void){ | ||
plodah_typingindicator_timer = timer_read(); | ||
plodah_typingindicator_active = true; | ||
} | ||
|
||
void plodah_typingindicator_check(void){ | ||
if(plodah_typingindicator_active){ | ||
if(timer_elapsed(plodah_typingindicator_timer) > PLODAH_TYPINGINDICATOR_DURATION){ | ||
plodah_typingindicator_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