Skip to content

Commit

Permalink
rename msjig token to specify purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
plodah committed Nov 8, 2024
1 parent 9b8bc55 commit fe50f01
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion users/plodah/functions/indicators.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ bool plodah_indicator_handler(void) {
if(!rgb_matrix_get_flags()){
rgb_matrix_set_color(PLODAH_MSJIGGLER_INDICATOR_RGBINDEX, RGB_OFF);
}
if(token != INVALID_DEFERRED_TOKEN){
if(msJigToken != INVALID_DEFERRED_TOKEN){
rgb_matrix_set_color(PLODAH_MSJIGGLER_INDICATOR_RGBINDEX, msjigrgb.r, msjigrgb.g, msjigrgb.b);
}
#endif // PLODAH_MSJIGGLER_ENABLED && PLODAH_MSJIGGLER_INDICATOR_RGBINDEX
Expand Down
14 changes: 7 additions & 7 deletions users/plodah/functions/mouse_jiggler.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
// cannibalised https://getreuer.info/posts/keyboards/macros3/index.html#a-mouse-jiggler to make this.
static deferred_token token = INVALID_DEFERRED_TOKEN;
static deferred_token msJigToken = INVALID_DEFERRED_TOKEN;
static report_mouse_t report = {0};

#if defined(RGB_MATRIX_ENABLE) && defined(PLODAH_MSJIGGLER_INDICATOR_RGBINDEX) && !defined(PLODAH_MSJIGGLER_INDICATOR_HSV)
Expand Down Expand Up @@ -42,22 +42,22 @@ void jiggler_onclick( uint16_t keycode ) {
#ifndef PLODAH_MSJIGGLER_AUTOSTOP
keycode == PL_MSJG &&
#endif // PLODAH_MSJIGGLER_AUTOSTOP
token
msJigToken
) {
cancel_deferred_exec(token);
token = INVALID_DEFERRED_TOKEN;
cancel_deferred_exec(msJigToken);
msJigToken = INVALID_DEFERRED_TOKEN;
report = (report_mouse_t){}; // Clear the mouse.
host_mouse_send(&report);
}
else if (keycode == PL_MSJG) {
#ifdef PLODAH_MSJIGGLER_PATTERN
#if PLODAH_MSJIGGLER_PATTERN == 1
token = defer_exec(1, jiggler_callback_figure, NULL);
msJigToken = defer_exec(1, jiggler_callback_figure, NULL);
#else // PLODAH_MSJIGGLER_PATTERN == 1
token = defer_exec(1, jiggler_callback_circle, NULL);
msJigToken = defer_exec(1, jiggler_callback_circle, NULL);
#endif // PLODAH_MSJIGGLER_PATTERN == 1
#else // PLODAH_MSJIGGLER_PATTERN
token = defer_exec(1, jiggler_callback_subtle, NULL);
msJigToken = defer_exec(1, jiggler_callback_subtle, NULL);
#endif // PLODAH_MSJIGGLER_PATTERN
}
}

0 comments on commit fe50f01

Please sign in to comment.