const__pageData=JSON.parse('{"title":"Tap Dance: A Single Key Can Do 3, 5, or 100 Different Things","description":"","frontmatter":{},"headers":[],"relativePath":"features/tap_dance.md","filePath":"features/tap_dance.md","lastUpdated":null}');
const_hoisted_1=/* @__PURE__ */createStaticVNode('<h1id="tap-dance-a-single-key-can-do-3-5-or-100-different-things"tabindex="-1">TapDance:ASingleKeyCanDo3,5,or100DifferentThings<aclass="header-anchor"href="#tap-dance-a-single-key-can-do-3-5-or-100-different-things"aria-label="Permalink to "Tap Dance: A Single Key Can Do 3, 5, or 100 Different Things""></a></h1><h2id="introduction"tabindex="-1">Introduction<aclass="header-anchor"href="#introduction"aria-label="Permalinkto"Introduction{#introduction}""></a></h2><p>Hitthesemicolonkeyonce,sendasemicolon.Hitittwice,rapidly--sendacolon.Hititthreetimes,andyourkeyboard'sLEDsdoawilddance.That'sjustoneexampleofwhatTapDancecando.It'soneofthenicestcommunity-contributedfeaturesinthefirmware,conceivedandcreatedby<ahref="https://github.com/algernon"target="_blank"rel="noreferrer">algernon</a>in<ahref="https://github.com/qmk/qmk_firmware/pull/451"target="_blank"rel="noreferrer">#451</a>.Here'showalgernondescribesthefeature:</p><p>Withthisfeatureonecanspecifykeysthatbehavedifferently,basedontheamountoftimestheyhavebeentapped,andwheninterrupted,theygethandledbeforetheinterrupter.</p><h2id="how-to-use"tabindex="-1">HowtoUseTapDance<aclass="header-anchor"href="#how-to-use"aria-label="Permalinkto"HowtoUseTapDance{#how-to-use}""></a></h2><p>First,youwillneed<code>TAP_DANCE_ENABLE=yes</code>inyour<code>rules.mk</code>,becausethefeatureisdisabledbydefault.Thisaddsalittlelessthan1ktothefirmwaresize.</p><p>Optionally,youmightwanttosetacustom<code>TAPPING_TERM</code>timebyaddingsomethinglikethisinyour<code>config.h</code>file:</p><divclass="language-cvp-adaptive-theme"><buttontitle="CopyCode"class="copy"></button><spanclass="lang">c</span><preclass="shikishiki-themesgithub-lightgithub-darkvp-code"><code><spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">TAPPING_TERM</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">175</span></span>\n<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">TAPPING_TERM_PER_KEY</span></span></code></pre></div><p>The<code>TAPPING_TERM</code>timeisthemaximumtimeallowedbetweentapsofyourTapDancekey,andismeasuredinmilliseconds.Forexample,ifyouusedtheabove<code>#define</code>statementandsetupaTapDancekeythatsends<code>Space</code>onsingle-tapand<code>Enter</code>ondouble-tap,thenthiskeywillsend<code>ENT</code>onlyifyoutapthiskeytwiceinlessthan175ms.Ifyoutapthekey,waitmorethan175ms,andtapthekeyagainyou'llendupsending<code>SPCSPC</code>instead.The<code>TAPPING_TERM_PER_KEY</code>definitionisonlyneededifyoucontrolthetappingtermthrougha<ahref="./../tap_hold#tapping_term">custom<code>get_tapping_term</code>function</a>,whichmaybeneededbecause<code>TAPPING_TERM</code>affectsnotjusttap-dancekeys.</p><p>Next,youwillwanttodefinesometap-dancekeys,whichiseasiesttodowiththe<code>TD()</code>macro.Thatmacrotakesanumberwhichwilllaterbeusedasanindexintothe<code>tap_dance_actions</code>arrayandturnsitintoatap-dancekeycode.</p><p>Afterthis,you'llwanttousethe<code>tap_dance_actions</code>arraytospecifywhatactionsshallbetakenwhenatap-dancekeyisinaction.Currently,therearefivepossibleoptions:</p><ul><li><code>ACTION_TAP_DANCE_DOUBLE(kc1,kc2)</code>:Sendsthe<code>kc1</code>keycodewhentappedonce,<code>kc2</code>otherwise.Whenthekeyisheld,theappropriatekeycodeisregistered:<code>kc1</code>whenpressedandheld,<code>kc2</code>whentappedonce,thenpressedandheld.</li><li><code>ACTION_TAP_DANCE_LAYER_MOVE(kc,layer)</code>:Sendsthe