+ return is_combo_active;
+}
+
+#define NO_COMBO_KEYS_ARE_DOWN (0 == combo->state)
+
+bool process_combo(uint16_t keycode, keyrecord_t *record) {
+ bool is_combo_key = false;
+ drop_buffer = false;
+ bool no_combo_keys_pressed = true;
+
+ if (keycode == CMB_ON && record->event.pressed) {
+ combo_enable();
+ return true;
+ }
+
+ if (keycode == CMB_OFF && record->event.pressed) {
+ combo_disable();
+ return true;
+ }
+
+ if (keycode == CMB_TOG && record->event.pressed) {
+ combo_toggle();
+ return true;
+ }
+
+ if (!is_combo_enabled()) { return true; }
+
+ for (current_combo_index = 0; current_combo_index < COMBO_COUNT;
+ ++current_combo_index) {
+ combo_t *combo = &key_combos[current_combo_index];
+ is_combo_key |= process_single_combo(combo, keycode, record);
+ no_combo_keys_pressed = no_combo_keys_pressed && NO_COMBO_KEYS_ARE_DOWN;
+ }
+
+ if (drop_buffer) {
+ /* buffer is only dropped when we complete a combo, so we refresh the timer
+ * here */
+ timer = timer_read();
+ dump_key_buffer(false);
+ } else if (!is_combo_key) {
+ /* if no combos claim the key we need to emit the keybuffer */
+ dump_key_buffer(true);
+
+ // reset state if there are no combo keys pressed at all
+ if (no_combo_keys_pressed) {
+ timer = 0;
+ is_active = true;