Add a keymatrix_t type

This contains both the matrix number and key position, in preparation
for multi-matrix support
This commit is contained in:
Fred Sundvik 2018-06-29 17:21:00 +03:00
parent c11c7948e6
commit f9c61b1bbe
14 changed files with 59 additions and 49 deletions

View file

@ -238,7 +238,8 @@ void keyboard_task(void)
for (uint8_t c = 0; c < MATRIX_COLS; c++) {
if (matrix_change & ((matrix_row_t)1<<c)) {
action_exec((keyevent_t){
.key = (keypos_t){ .row = r, .col = c },
// The main matrix is always 0
.key = (keymatrix_t){.pos = (keypos_t){ .row = r, .col = c }, .matrix = 0},
.pressed = (matrix_row & ((matrix_row_t)1<<c)),
.time = (timer_read() | 1) /* time should not be 0 */
});