vial-kb / vial-qmk

QMK fork with Vial-specific features.
https://get.vial.today/
GNU General Public License v2.0
830 stars 2.39k forks source link

tap-hold behavior #215

Open jhorology opened 2 years ago

jhorology commented 2 years ago

Is following behavior of tap-hold is correct?

E.g.) normaly alt, shift on tap_hold.

      |<--tapping term-->|
alt __|‾|___|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ 
'a' ______________|‾|________|‾|___
                  'a'        'A'

If it's not the intention, I think it's better and natural behavior to fix this part as follows:

        if (state->pressed) return DOUBLE_HOLD;
        else if (state->interrupted) return DOUBLE_SINGLE_TAP;
        else return DOUBLE_TAP;
xyzz commented 2 years ago

Yes, it is intended to mimic qmk's behavior: https://docs.qmk.fm/#/feature_tap_dance

  • Interrupted: If the state of a dance is "interrupted", that means that another key has been hit
  • under the tapping term. This is typically indicitive that you are trying to "tap" the key.
jhorology commented 2 years ago

Is there a reason for following just a example code? I can't imagine advantage and use case of DOUBLE_SINGLE_TAP. Beside, VIAL can't define keycode of DOUBLE_SINGLE_TAP.

xyzz commented 2 years ago

It's as explained in the docs -

   // Last case is for fast typing. Assuming your key is `f`:
   // For example, when typing the word `buffer`, and you want to make sure that you send `ff` and not `Esc`.
   // In order to type `ff` when typing fast, the next character will have to be hit within the `TAPPING_TERM`, which by default is 200ms.

Yes you cannot define a separate key but it will enter the "tap" key twice in this case.