# \`WhileLongPressed\`

**URL:** <https://forums.fusetools.com/t/whilelongpressed/5743>\
**Category:** Feature Suggestions\
**Created:** [April 13, 2016, 7:10pm UTC](https://forums.fusetools.com/t/whilelongpressed/5743 "2016-04-13T19:10:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Helder\_Araujo](https://avatars.discourse-cdn.com/v4/letter/h/cab0a1/32.png) [@Helder\_Araujo](https://forums.fusetools.com/u/Helder_Araujo)\
**Post date:** [April 13, 2016, 7:10pm UTC](https://forums.fusetools.com/t/whilelongpressed/5743/1 "2016-04-13T19:10:34Z")

</div>

Is there a `WhileLongPressed`? I want to make an element draggable just when is longpressed and clickable/tappable otherwise. Using just the `WhilePressed` it takes the tap away…

---

<div class="post-metadata">

**Author:** ![edA-qa\_mort-ora-y](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/eda-qa_mort-ora-y/32/124_2.png) [@edA-qa\_mort-ora-y](https://forums.fusetools.com/u/edA-qa_mort-ora-y)\
**Post date:** [April 14, 2016, 6:26am UTC](https://forums.fusetools.com/t/whilelongpressed/5743/2 "2016-04-14T06:26:13Z")

</div>

You won’t be able to achieve what you want right now in UX. The core problem is th inability to transfer from one gesture to another: from the pressed to the dragging gesture.

The below code shows basically what we want, missing the transference bit. While it does add the `Draggable` behaviour that is too late to see the pointer pressed event, thus won’t actually start dragging. The other components however show a setup that would otherwise work to enable something on long-press until released.

```auto
<Panel Width="100" Height="100" Alignment="Center" Color="0.5,0.5,0,1" ux:Name="TheTarget">
    <WhileTrue ux:Name="Activated">
        <Change TheTarget.Color="0,1,0,1" Duration="0.5"/>
        <Draggable/>
    </WhileTrue>

    <LongPressed>
        <Set Activated.Value="true"/>
    </LongPressed>
    <WhilePressed>
        <Set Activated.Value="false" Direction="Backward"/>
    </WhilePressed>
    <Tapped>
        <Change TheTarget.Color="1,0,0,1" Duration="0.5"/>
    </Tapped>
</Panel>

```

All the various pointer events, `clicked`, `Tapped`, `LongPressed`, `whilePressed`, etc. can coexist on an element and shouldn’t interfere with each other. Whether it’s a good UX or not is another question however. 🙂

I’ll file an issue about the gesture transferring with this use-case as a reference. Other use-cases have come up before, the reason why `CancelInteractions` was introduced (which can only cancel though, not transfer).
