Demo cleanup/enhance

This commit is contained in:
Ryan McGrath 2011-07-10 04:24:44 -04:00
parent 110ff45540
commit b8bfcdf743

View file

@ -155,10 +155,8 @@ Wii.parsePrimaryWiimote = function(e) {
* Filter down and figure out which "event" we're really looking at based on code * Filter down and figure out which "event" we're really looking at based on code
* matchups; this gets messy pretty quickly... * matchups; this gets messy pretty quickly...
*/ */
if(typeof buttonPressed !== 'undefined' && wii_remote.evtsInterestedIn[buttonPressed] !== 'undefined') { if(typeof buttonPressed !== 'undefined' && typeof wii_remote.evtsInterestedIn[buttonPressed] === 'function') {
alert(typeof buttonPressed + ' || ' + buttonPressed); wii_remote.evtsInterestedIn[buttonPressed](wii_remote, wii_remoteCurrStatus);
alert(wii_remote.evtsInterestedIn[buttonPressed]);
try { wii_remote.evtsInterestedIn[buttonPressed](wii_remote, wii_remoteCurrStatus); } catch(e) { alert(e.message); alert(Wii.currentBrowsingRemote); }
} }
/* Doing this in conjunction with preventDefault() halts an odd clicking bug or two. */ /* Doing this in conjunction with preventDefault() halts an odd clicking bug or two. */