# Keyboard codes for input WASD vs ZQSD on AZERTY keyboard?

**URL:** <https://phaser.discourse.group/t/keyboard-codes-for-input-wasd-vs-zqsd-on-azerty-keyboard/7237>\
**Category:** Phaser 3\
**Created:** [August 21, 2020, 11:03am UTC](https://phaser.discourse.group/t/keyboard-codes-for-input-wasd-vs-zqsd-on-azerty-keyboard/7237 "2020-08-21T11:03:45Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![BdR](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/bdr/32/2621_2.png) [@BdR](https://phaser.discourse.group/u/BdR)\
**Post date:** [September 26, 2020, 12:06pm UTC](https://phaser.discourse.group/t/keyboard-codes-for-input-wasd-vs-zqsd-on-azerty-keyboard/7237/9 "2020-09-26T12:06:23Z")

</div>

I forgot to reply, but given these keyCodes I see that there is no overlap between the QWERTY and AZERTY keycodes and the directions, the combinations keyCode/directions are all unique. In other words there is no keyCode used for one certain direction in QWERTY and a different direction in AZERTY.

So… there is no need to distinguish between the two keyboard layouts and I just do this 😃

```
onKeyDown: function(evt) {
	var dir = DIR_NONE;

	// cursors
	if (evt.keyCode === 38) dir = DIR_UP; // cursor up
	if (evt.keyCode === 40) dir = DIR_DOWN; // cursor down
	if (evt.keyCode === 37) dir = DIR_LEFT; // cursor left
	if (evt.keyCode === 39) dir = DIR_RIGHT; // cursor right

	// WASD
	if (evt.keyCode === 87) dir = DIR_UP; // W
	if (evt.keyCode === 83) dir = DIR_DOWN; // S
	if (evt.keyCode === 65) dir = DIR_LEFT; // A
	if (evt.keyCode === 68) dir = DIR_RIGHT; // D
	// ZQSD azerty keyboard support
	if (evt.keyCode === 90) dir = DIR_UP; // Z
	//if (evt.keyCode === 83) dir = DIR_DOWN; // S same as QWERTY
	if (evt.keyCode === 81) dir = DIR_LEFT; // Q
	//if (evt.keyCode === 68) dir = DIR_RIGHT; // D same as QWERTY

	// handle input
	// etc.
};
```

---

_[View the full topic](https://phaser.discourse.group/t/keyboard-codes-for-input-wasd-vs-zqsd-on-azerty-keyboard/7237)._
