-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keyisdown fix #454
keyisdown fix #454
Conversation
@@ -166,7 +166,8 @@ define(function (require) { | |||
'touchstart': null, | |||
'touchmove': null, | |||
'touchend': null, | |||
'resize': null | |||
'resize': null, | |||
'blur' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't 'blur'
follow same convention as the others above and initialized w/ null
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes i noticed that aswell... idk i did it right the first time ... long day
sorry i compiled and got 0 errors
On Mon, Dec 8, 2014 at 10:15 AM, GoToLoop [email protected] wrote:
In src/core/core.js:
@@ -166,7 +166,8 @@ define(function (require) {
'touchstart': null,
'touchmove': null,
'touchend': null,
'resize': null
'resize': null,
'blur'
Shouldn't 'blur' follow same convention as the others above and
initialized w/ null as well?—
Reply to this email directly or view it on GitHub
https://github.com/lmccart/p5.js/pull/454/files#r21463119.
Darby Rathbone
(512) 420-6869
changing focus stops the keyboard example circle from moving around as it should rather than before where it would go for ever if you let the key up while not focused on the window |
* been released. | ||
*/ | ||
p5.prototype.onblur = function (e) { | ||
downKeys =[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you haven't paid attention @ our https://github.com/lmccart/p5.js/pull/411 thread that downKeys isn't implemented as an Array
anymore but as an Object
! O_o
It gotta be downKeys = {};
now!
lol you are right i didn't follow the whole conversation because I couldn't understand why it mattered since an array is an object also... but why don't we make it an empty object without the Object.prototype. By using Object.create(null);
* been released. | ||
*/ | ||
p5.prototype.onblur = function (e) { | ||
downKeys = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you know Object.create(null) is a smaller object than {} since it doesn't have the Object.prototype. i said this on the commit somewhere bleh i need some sleep
👍 @darbicus deserves 1 cappucino! @changetip |
Hi @darbicus, @limikael sent you a Bitcoin tip worth 1 cappucino (9,950 bits/$3.50), and I'm here to deliver it ➔ collect your tip. |
Thank you @limikael. I've never heard of ChangeTip, cool. |
sorry needed to unbreak it...