fredsa / playn

Cross platform game library for N≥4 platforms
0 stars 1 forks source link

Add Events.Input.setPreventDefault(bool) to prevent the default platform behavior for events #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Purpose of code changes on this branch:
This is a first-pass at adding Events.Input.setPreventDefault and I'd like to 
get some initial feedback. This won't be submitted until I run a few more tests 
and update the samples.

While it's not a statically breaking change, many users will need to add 
event.setPreventDefault(true) to their event listeners to keep their current 
behavior. Another route we could go is to return a boolean from all event 
listener methods, which would be more discoverable, but it would be a truly 
breaking change.

When reviewing my code changes, please focus on:
http://code.google.com/r/pdr-playn/source/detail?r=5bfb64603ed39a05374a90a0b144b
54ad07851e3&name=preventdefault

Original issue reported on code.google.com by pdr@google.com on 21 Aug 2011 at 9:59

GoogleCodeExporter commented 9 years ago

Original comment by pdr@google.com on 21 Aug 2011 at 10:02

GoogleCodeExporter commented 9 years ago
Rebased and updated to avoid the static preventDefault variable (ends up being 
cleaner): 
http://code.google.com/r/pdr-playn/source/detail?r=6c42db78e24f82b331a450a906716
e8329c6def8&name=preventdefault2

I think this is good to submit now, as the samples don't really need updating 
after all. If there are no further comments, I'll submit this tomorrow.

Original comment by pdr@google.com on 4 Sep 2011 at 7:13

GoogleCodeExporter commented 9 years ago
Committed as 
http://code.google.com/p/playn/source/detail?r=db6b7846f0eed18fbc0787a22b33490a2
f9e1974

Original comment by pdr@google.com on 5 Sep 2011 at 6:08