Skip to content

Commit e5918cf

Browse files
authored
Heatmap incorrect matrix effect workaround (#16315)
1 parent 030a96a commit e5918cf

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

docs/feature_rgb_matrix.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -657,18 +657,19 @@ You can enable a single effect by defining `ENABLE_[EFFECT_NAME]` in your `confi
657657

658658
### RGB Matrix Effect Typing Heatmap :id=rgb-matrix-effect-typing-heatmap
659659

660-
This effect will color the RGB matrix according to a heatmap of recently pressed
661-
keys. Whenever a key is pressed its "temperature" increases as well as that of
662-
its neighboring keys. The temperature of each key is then decreased
663-
automatically every 25 milliseconds by default.
660+
This effect will color the RGB matrix according to a heatmap of recently pressed keys. Whenever a key is pressed its "temperature" increases as well as that of its neighboring keys. The temperature of each key is then decreased automatically every 25 milliseconds by default.
664661

665-
In order to change the delay of temperature decrease define
666-
`RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS`:
662+
In order to change the delay of temperature decrease define `RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS`:
667663

668664
```c
669665
#define RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS 50
670666
```
671667
668+
Heatmap effect may not light up the correct adjacent LEDs for certain key matrix layout such as split keyboards. The following define will limit the effect to pressed keys only:
669+
```c
670+
#define RGB_MATRIX_TYPING_HEATMAP_SLIM
671+
```
672+
672673
## Custom RGB Matrix Effects :id=custom-rgb-matrix-effects
673674

674675
By setting `RGB_MATRIX_CUSTOM_USER = yes` in `rules.mk`, new effects can be defined directly from your keymap or userspace, without having to edit any QMK core files. To declare new effects, create a `rgb_matrix_user.inc` file in the user keymap directory or userspace folder.

quantum/rgb_matrix/animations/typing_heatmap_anim.h

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ RGB_MATRIX_EFFECT(TYPING_HEATMAP)
77
# endif
88

99
void process_rgb_matrix_typing_heatmap(uint8_t row, uint8_t col) {
10+
# ifdef RGB_MATRIX_TYPING_HEATMAP_SLIM
11+
// Limit effect to pressed keys
12+
g_rgb_frame_buffer[row][col] = qadd8(g_rgb_frame_buffer[row][col], 32);
13+
# else
1014
uint8_t m_row = row - 1;
1115
uint8_t p_row = row + 1;
1216
uint8_t m_col = col - 1;
@@ -27,6 +31,7 @@ void process_rgb_matrix_typing_heatmap(uint8_t row, uint8_t col) {
2731
g_rgb_frame_buffer[m_row][col] = qadd8(g_rgb_frame_buffer[m_row][col], 16);
2832
if (p_col < MATRIX_COLS) g_rgb_frame_buffer[m_row][p_col] = qadd8(g_rgb_frame_buffer[m_row][p_col], 13);
2933
}
34+
# endif
3035
}
3136

3237
// A timer to track the last time we decremented all heatmap values.

0 commit comments

Comments
 (0)