Skip to content

last_hit_buffer in quantum/rgb_matrix.c does not properly maintain counts if a custom rgb_matrix_map_row_column_to_led_kb is defined that returns nonzero #12673

@jhanschoo

Description

@jhanschoo

last_hit_buffer.count--;

should read last_hit_buffer.count = LED_HITS_TO_REMEMBER - led_count;, so that after

last_hit_buffer.count++;

that is executed led_count times, last_hit_buffer.count will be equal to LED_HITS_TO_REMEMBER

Present behavior:
the last_hit_buffer may remember less and less keys pressed and eventually stop remembering new keypresses if a custom rgb_matrix_map_row_column_to_led_kb is defined returning nonzero, causing problems with reactive RGB matrix effects with stale keypresses (older than the last LED_HITS_TO_REMEMBER keypresses) being remembered.

Expected behavior:
the last_hit_buffer should not have amnesia and always be able to maintain the last LED_HITS_TO_REMEMBER keypresses as long as rgb_matrix_map_row_column_to_led_kb always returns a value strictly less than LED_HITS_TO_REMEMBER (so that rgb_matrix_map_row_column_to_led always returns a value less then or equal to LED_HITS_TO_REMEMBER).

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleIssues or pull requests that have become inactive without resolution.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions