# WASD keyboard movement (Phaser 3)

**URL:** <https://phaser.discourse.group/t/wasd-keyboard-movement-phaser-3/8297>\
**Category:** Examples\
**Created:** [December 7, 2020, 9:05am UTC](https://phaser.discourse.group/t/wasd-keyboard-movement-phaser-3/8297 "2020-12-07T09:05:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [December 7, 2020, 9:05am UTC](https://phaser.discourse.group/t/wasd-keyboard-movement-phaser-3/8297/1 "2020-12-07T09:05:27Z")

</div>

https://codepen.io/samme/embed/preview/QWKyRBm?height=300&slug-hash=QWKyRBm&default-tabs=js,result&host=https://codepen.io

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [December 7, 2020, 5:21pm UTC](https://phaser.discourse.group/t/wasd-keyboard-movement-phaser-3/8297/2 "2020-12-07T17:21:49Z")

</div>

There are two ways you can use [addKeys()](https://photonstorm.github.io/phaser3-docs/Phaser.Input.Keyboard.KeyboardPlugin.html#addKeys):

```nohighlight
var keys = this.input.keyboard.addKeys("W,A,S,D");
// -> { W: Key, A: Key, S: Key, D: Key }

```

```nohighlight
var keys = this.input.keyboard.addKeys({ up: 'W', left: 'A', down: 'S', right: 'D' });
// -> { up: Key, left: Key, down: Key, right: Key }

```
