Skip to content

Commit 32de58c

Browse files
author
Chris Hallberg
committed
Set key and keyCode for keyReleased.
1 parent 1206d62 commit 32de58c

File tree

3 files changed

+28
-16
lines changed

3 files changed

+28
-16
lines changed

lib/p5.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! p5.js v0.3.7 September 20, 2014 */
1+
/*! p5.js v0.3.7 September 24, 2014 */
22
var shim = function (require) {
33
window.requestDraw = function () {
44
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback, element) {
@@ -2974,6 +2974,12 @@ var inputkeyboard = function (require, core) {
29742974
var keyReleased = this.keyReleased || window.keyReleased;
29752975
this._setProperty('isKeyPressed', false);
29762976
this._setProperty('keyIsPressed', false);
2977+
var key = String.fromCharCode(e.which);
2978+
if (!key) {
2979+
key = e.which;
2980+
}
2981+
this._setProperty('key', key);
2982+
this._setProperty('keyCode', e.which);
29772983
if (typeof keyReleased === 'function') {
29782984
keyReleased(e);
29792985
}

0 commit comments

Comments
 (0)