void pre_invoke_functions() { for(int i = 0; i < pressed_count; i++) { unsigned int keycode = current_layer[presses[i]]; if(keycode >= MIN_PRE_FUNCTION && keycode <= MAX_PRE_FUNCTION) { (layer_functions[keycode - MIN_PRE_FUNCTION])(); } } per_cycle(); };
void pre_invoke_functions() { uint32_t i; for (i = 0; i < LAYER_COUNT * KEY_COUNT; i++) { if (matrix_state[i] >= DEBOUNCE_PASSES ) { uint8_t layer = i / KEY_COUNT; uint8_t row = (i - layer * KEY_COUNT) / COLUMN_COUNT; // Keys are wired from right to left but layout goes from left to right uint8_t column = COLUMN_COUNT - (i - layer * KEY_COUNT - row * COLUMN_COUNT + 1); uint64_t keycode = layers[layer][row * COLUMN_COUNT + column]; if (IS_PRE_FUNCTION(keycode)) { /* DEBUG("pre: "); debug_phex(keycode & PRE_FUNCTION_MASK); DEBUG("\r\n"); */ (layer_functions[keycode & PRE_FUNCTION_MASK])(); } } } per_cycle(); }