Demo cleanup/enhance
This commit is contained in:
parent
b8bfcdf743
commit
84d2e8b9c1
1 changed files with 3 additions and 2 deletions
|
|
@ -106,7 +106,7 @@ Wii.listen = function() {
|
||||||
} else {
|
} else {
|
||||||
for(var evt in wii_remote.evtsInterestedIn) {
|
for(var evt in wii_remote.evtsInterestedIn) {
|
||||||
var evtHappened = Wii.DISPATCHER[evt](wii_remote, wii_remoteCurrStatus);
|
var evtHappened = Wii.DISPATCHER[evt](wii_remote, wii_remoteCurrStatus);
|
||||||
if(evtHappened) try { wii_remote.evtsInterestedIn[evt](wii_remote, wii_remoteCurrStatus); } catch(e) { alert(e.message); }
|
if(evtHappened) wii_remote.evtsInterestedIn[evt](wii_remote, wii_remoteCurrStatus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -156,7 +156,8 @@ Wii.parsePrimaryWiimote = function(e) {
|
||||||
* matchups; this gets messy pretty quickly...
|
* matchups; this gets messy pretty quickly...
|
||||||
*/
|
*/
|
||||||
if(typeof buttonPressed !== 'undefined' && typeof wii_remote.evtsInterestedIn[buttonPressed] === 'function') {
|
if(typeof buttonPressed !== 'undefined' && typeof wii_remote.evtsInterestedIn[buttonPressed] === 'function') {
|
||||||
wii_remote.evtsInterestedIn[buttonPressed](wii_remote, wii_remoteCurrStatus);
|
try { wii_remote.evtsInterestedIn[buttonPressed](wii_remote, wii_remoteCurrStatus);
|
||||||
|
} catch(e) { alert(e.message); }
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 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. */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue