Heatmap incorrect matrix effect workaround (#16315)
parent
030a96a3f5
commit
e5918cf968
|
@ -657,18 +657,19 @@ You can enable a single effect by defining `ENABLE_[EFFECT_NAME]` in your `confi
|
||||||
|
|
||||||
### RGB Matrix Effect Typing Heatmap :id=rgb-matrix-effect-typing-heatmap
|
### RGB Matrix Effect Typing Heatmap :id=rgb-matrix-effect-typing-heatmap
|
||||||
|
|
||||||
This effect will color the RGB matrix according to a heatmap of recently pressed
|
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.
|
||||||
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.
|
|
||||||
|
|
||||||
In order to change the delay of temperature decrease define
|
In order to change the delay of temperature decrease define `RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS`:
|
||||||
`RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS`:
|
|
||||||
|
|
||||||
```c
|
```c
|
||||||
#define RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS 50
|
#define RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS 50
|
||||||
```
|
```
|
||||||
|
|
||||||
|
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:
|
||||||
|
```c
|
||||||
|
#define RGB_MATRIX_TYPING_HEATMAP_SLIM
|
||||||
|
```
|
||||||
|
|
||||||
## Custom RGB Matrix Effects :id=custom-rgb-matrix-effects
|
## Custom RGB Matrix Effects :id=custom-rgb-matrix-effects
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
|
@ -7,6 +7,10 @@ RGB_MATRIX_EFFECT(TYPING_HEATMAP)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
void process_rgb_matrix_typing_heatmap(uint8_t row, uint8_t col) {
|
void process_rgb_matrix_typing_heatmap(uint8_t row, uint8_t col) {
|
||||||
|
# ifdef RGB_MATRIX_TYPING_HEATMAP_SLIM
|
||||||
|
// Limit effect to pressed keys
|
||||||
|
g_rgb_frame_buffer[row][col] = qadd8(g_rgb_frame_buffer[row][col], 32);
|
||||||
|
# else
|
||||||
uint8_t m_row = row - 1;
|
uint8_t m_row = row - 1;
|
||||||
uint8_t p_row = row + 1;
|
uint8_t p_row = row + 1;
|
||||||
uint8_t m_col = col - 1;
|
uint8_t m_col = col - 1;
|
||||||
|
@ -27,6 +31,7 @@ void process_rgb_matrix_typing_heatmap(uint8_t row, uint8_t col) {
|
||||||
g_rgb_frame_buffer[m_row][col] = qadd8(g_rgb_frame_buffer[m_row][col], 16);
|
g_rgb_frame_buffer[m_row][col] = qadd8(g_rgb_frame_buffer[m_row][col], 16);
|
||||||
if (p_col < MATRIX_COLS) g_rgb_frame_buffer[m_row][p_col] = qadd8(g_rgb_frame_buffer[m_row][p_col], 13);
|
if (p_col < MATRIX_COLS) g_rgb_frame_buffer[m_row][p_col] = qadd8(g_rgb_frame_buffer[m_row][p_col], 13);
|
||||||
}
|
}
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// A timer to track the last time we decremented all heatmap values.
|
// A timer to track the last time we decremented all heatmap values.
|
||||||
|
|
Loading…
Reference in New Issue