# Move triangle up and down using 'w' and 's' keys

**URL:** <https://discourse.processing.org/t/move-triangle-up-and-down-using-w-and-s-keys/31855>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [August 23, 2021, 7:31am UTC](https://discourse.processing.org/t/move-triangle-up-and-down-using-w-and-s-keys/31855 "2021-08-23T07:31:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NewCoder1](https://avatars.discourse-cdn.com/v4/letter/n/c6cbf5/32.png) [@NewCoder1](https://discourse.processing.org/u/NewCoder1)\
**Post date:** [August 23, 2021, 7:31am UTC](https://discourse.processing.org/t/move-triangle-up-and-down-using-w-and-s-keys/31855/1 "2021-08-23T07:31:42Z")

</div>

Hey I need help with moving my triangle up and down using the ‘w’ and ‘s’ keys. I’ve tried many different types of codes such as using keyPressed, etc but it hasn’t worked out for me. This is what I have at the moment

size(500,500); {

}

triangle(20,10,80,30,20,50);{

}

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [August 23, 2021, 10:21am UTC](https://discourse.processing.org/t/move-triangle-up-and-down-using-w-and-s-keys/31855/2 "2021-08-23T10:21:18Z")

</div>

Hello,

Explore the resources available here:

> **[Welcome to Processing!](https://processing.org/)**
>
> Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts. Since 2001, Processing has promoted software literacy within the visual arts…

To interact with the triangle you will need at least:

- setup()
- draw()
- keyboard control

`:)`
