# How to get X and Y coordinates on whilePressed!

**URL:** <https://forums.fusetools.com/t/how-to-get-x-and-y-coordinates-on-whilepressed/7274>\
**Category:** How-to Discussions\
**Created:** [July 9, 2018, 6:15pm UTC](https://forums.fusetools.com/t/how-to-get-x-and-y-coordinates-on-whilepressed/7274 "2018-07-09T18:15:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aeq](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/aeq/32/129_2.png) [@aeq](https://forums.fusetools.com/u/aeq)\
**Post date:** [July 9, 2018, 6:15pm UTC](https://forums.fusetools.com/t/how-to-get-x-and-y-coordinates-on-whilepressed/7274/1 "2018-07-09T18:15:40Z")

</div>

```auto
<WhilePressed ux:Name="wpressed">
	<Rectangle ux:Name="rect" Position="{SnapshotProperty wpressed.PressedPosition}" Placed="{rectPlaced}" Anchor="0%,0%" Width="20" Height="20" Color="#8f10" />

	<Callback Handler="{onPressed}" />
</WhilePressed>

```

1. Get x and y from args, from rectPlaced function, and assign them to Observables (or do whatever you want with them)
2. In onPressed function, use observables
