ソースを参照

Merge remote-tracking branch 'origin/develop' into xap

QMK Bot 9 ヶ月 前
コミット
13defe183b
2 ファイル変更17 行追加0 行削除
  1. 7 0
      quantum/action_tapping.c
  2. 10 0
      quantum/action_tapping.h

+ 7 - 0
quantum/action_tapping.c

@@ -883,6 +883,13 @@ static bool flow_tap_key_if_within_term(keyrecord_t *record, uint16_t prev_time)
     return false;
 }
 
+// Checks both flow_tap_expired flag and elapsed time to determine
+// if the key is within the flow tap term.
+bool within_flow_tap_term(uint16_t keycode, keyrecord_t *record) {
+    uint16_t term = get_flow_tap_term(keycode, record, flow_tap_prev_keycode);
+    return !flow_tap_expired && TIMER_DIFF_16(record->event.time, flow_tap_prev_time) <= term;
+}
+
 // By default, enable Flow Tap for the keys in the main alphas area and Space.
 // This should work reasonably even if the layout is remapped on the host to an
 // alt layout or international layout (e.g. Dvorak or AZERTY), where these same

+ 10 - 0
quantum/action_tapping.h

@@ -169,6 +169,16 @@ uint16_t get_flow_tap_term(uint16_t keycode, keyrecord_t *record, uint16_t prev_
 
 /** Updates the Flow Tap last key and timer. */
 void flow_tap_update_last_event(keyrecord_t *record);
+
+/**
+ * Checks if the pressed key is within the flow tap term.
+ * Can be used to avoid triggering combos or other actions within the flow tap term.
+ *
+ * @param keycode The keycode of the pressed key.
+ * @param record The keyrecord of the pressed key.
+ * @return True if the pressed key is within the flow tap term; false otherwise.
+ */
+bool within_flow_tap_term(uint16_t keycode, keyrecord_t *record);
 #endif // FLOW_TAP_TERM
 
 #ifdef DYNAMIC_TAPPING_TERM_ENABLE