Qmk_firmware: tap dance for MO() and TG() based on count? Or custom oneshot?

Created on 10 Jan 2017  Â·  9Comments  Â·  Source: qmk/qmk_firmware

Hi,

I do have tap dance working for simple keys... but fail with something like this:

ACTION_TAP_DANCE_DOUBLE( MO(1), TG(1) )

Is this supposed to work?

Instead I'd be happy with OSL() ... but due to the timeout bug and lack of possibility to easily deactivate the oneshot state, I don't get along with it... no matter if I use oneshot toggle or not.

thanks

All 9 comments

its possible. you have to make a custom key, then assign that somewhere and have it work as a tapdance key. then you make the action of the tapdance as you want. i have it so if i tap once, i go to one layer. if i tap twice, i go to another layer. then while in any of the two layers, if i tap once i go back to the initial layer.
you can check that here https://github.com/jackhumbert/qmk_firmware/blob/master/keyboards/ergodox/keymaps/pvinis/keymap.c#L474 and here https://github.com/jackhumbert/qmk_firmware/blob/master/keyboards/ergodox/keymaps/pvinis/keymap.c#L448-L470 and here https://github.com/jackhumbert/qmk_firmware/blob/master/keyboards/ergodox/keymaps/pvinis/keymap.c#L25.
(i think i have a bug where if i tap once, then tap twice, im stuck in one of the layers and cant go back, but eh, i dont do that. i will fix it later.)

Thanks for sharing. I see... you coded up the toggle yourself. So in fact using the "easy" TG() by itself might be incompatible with tap dance.

I glanced at the tapdance code in process_tap_dance.c... and I got the impression, it's just handling key presses... the release appears to be ignored (or I missed it). That'd be a show stopper for MO() like layer switching while holding down a key.... hmm...

@pvinis: The reason why you have a bug when you tap three times is because you don't have a default case statement for your switch block.

See this for an example: https://github.com/blakedietz/qmk_firmware/blob/hhkb/keyboards/hhkb/keymaps/blakedietz/keymap.c#L167-L169.

Thanks for that snippet. It helped me to implement my own layer switching for my hhkb.

@blakedietz hm, i thought about it, but its not that actually. when i tap once, i go to layer sysctl. then i tap twice, and i go to layer mouse without checking. so i think i would either put a switch in the case 2:, or better, maybe instead of trns in the two non-base layers, i should have an other key thats justs goes turns the current layer off.

I'm closing this to clean up our open issues, but if you still have questions @rclasen please reopen this or open a new issue.

ALL THE LINKS ARE 404_ERRORS NOW !!!

Where can we get those sources ?
I need to implement this functionality !!!

Thanks anyone can help !!!

sorry for the delay. thanks @noroadsleft. enjoy @xcode-manolo. I'm updating my keymap this week too :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BenRoe picture BenRoe  Â·  3Comments

drashna picture drashna  Â·  3Comments

fredizzimo picture fredizzimo  Â·  4Comments

levitanong picture levitanong  Â·  3Comments

gesinger picture gesinger  Â·  3Comments