Skip to content
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

Merged
merged 6 commits into from
Dec 8, 2014
Merged

keyisdown fix #454

merged 6 commits into from
Dec 8, 2014

Conversation

darbicus
Copy link
Contributor

@darbicus darbicus commented Dec 8, 2014

sorry needed to unbreak it...

@@ -166,7 +166,8 @@ define(function (require) {
'touchstart': null,
'touchmove': null,
'touchend': null,
'resize': null
'resize': null,
'blur'
Copy link
Contributor

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?

Copy link
Contributor Author

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

@darbicus
Copy link
Contributor Author

darbicus commented Dec 8, 2014

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 =[];
Copy link
Contributor

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 = {};
Copy link
Contributor Author

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

lmccart pushed a commit that referenced this pull request Dec 8, 2014
@lmccart lmccart merged commit bc7c20e into processing:master Dec 8, 2014
@lmccart
Copy link
Member

lmccart commented Dec 8, 2014

fantastic! thanks @darbicus and for the code review @GoToLoop

@limikael
Copy link
Contributor

limikael commented Dec 9, 2014

👍 @darbicus deserves 1 cappucino! @changetip

@changetip
Copy link

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.

Learn more about ChangeTip

@darbicus
Copy link
Contributor Author

darbicus commented Dec 9, 2014

Thank you @limikael. I've never heard of ChangeTip, cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants