We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent edabfc2 commit 661c4d5Copy full SHA for 661c4d5
src/input/keyboard.js
@@ -223,6 +223,15 @@ define(function (require) {
223
}
224
225
};
226
+ /**
227
+ * The onblur function is called when the user is no longer focused
228
+ * on the p5 element. Because the keyup events will no fire if the user is
229
+ * not focused on the element we must assume all keys currently down have
230
+ * been released.
231
+ */
232
+ p5.prototype.onblur = function (e) {
233
+ downKeys =[];
234
+ };
235
236
/**
237
* The keyIsDown function checks if the key is currently down, i.e. pressed.
0 commit comments