rev
2014-09-15 08:49:34 UTC
Hi list,
I was working on a project involving a Wii when I've encountered a strange
behaviour of the event responders.
In brief, although WiiMote packet requires to specify with a key the button
to associate to any single event, I see upon defining different events to
different keys they are all activated together when any button on the Wii is
pressed (I'm using a standard WiiMote without nunchuck).
Example based on help file (initialization not shown):
w.setAction( \bA, { |v| v.postln; } );
w.setAction( \bB, { |v| v.postln; } );
This will post both A and B buttons status when ANY button on the WiiMote is
pressed (A,B, home, +, -,... You get it, all of them. Accelerometer has no
effect, though). So it seems the action is triggered not by the specified
button being pressed, but by any modification in the buttonData array. In my
very limited understanding, I'd suggest that's because of this chunk in
WII.sc :
prHandleButtonEvent{ |buttonData|
// buttonData are bits that decode to separate buttons (do in
Primitive internally, and pass on Array?
//("handle button Event"+buttonData).postln;
remote_buttons = buttonData;
[ \bA, \bB, \bOne, \bTwo, \bMinus, \bHome, \bPlus, \bUp, \bDown,
\bLeft, \bRight ].do{ |key|
actionSpec.at( key ).value( spec.at(key).value );
if ( dumpEvents, { (key +
spec.at(key).value.round(0.00001)).postln; });
}
}
it seems to be triggered by the whole array and then it launches an action
for any single button, regardless it has been pressed or not.
I don't know if this effect is wanted or not, nor I am an expert on actions,
but should this is a bug I'd like to point it out, should this be normal I'd
ask how I could define an action to be triggered only when a particular
button is pressed.
Thank You and
regards,
rev
--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/WiiMote-event-triggering-issue-tp7613407.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
I was working on a project involving a Wii when I've encountered a strange
behaviour of the event responders.
In brief, although WiiMote packet requires to specify with a key the button
to associate to any single event, I see upon defining different events to
different keys they are all activated together when any button on the Wii is
pressed (I'm using a standard WiiMote without nunchuck).
Example based on help file (initialization not shown):
w.setAction( \bA, { |v| v.postln; } );
w.setAction( \bB, { |v| v.postln; } );
This will post both A and B buttons status when ANY button on the WiiMote is
pressed (A,B, home, +, -,... You get it, all of them. Accelerometer has no
effect, though). So it seems the action is triggered not by the specified
button being pressed, but by any modification in the buttonData array. In my
very limited understanding, I'd suggest that's because of this chunk in
WII.sc :
prHandleButtonEvent{ |buttonData|
// buttonData are bits that decode to separate buttons (do in
Primitive internally, and pass on Array?
//("handle button Event"+buttonData).postln;
remote_buttons = buttonData;
[ \bA, \bB, \bOne, \bTwo, \bMinus, \bHome, \bPlus, \bUp, \bDown,
\bLeft, \bRight ].do{ |key|
actionSpec.at( key ).value( spec.at(key).value );
if ( dumpEvents, { (key +
spec.at(key).value.round(0.00001)).postln; });
}
}
it seems to be triggered by the whole array and then it launches an action
for any single button, regardless it has been pressed or not.
I don't know if this effect is wanted or not, nor I am an expert on actions,
but should this is a bug I'd like to point it out, should this be normal I'd
ask how I could define an action to be triggered only when a particular
button is pressed.
Thank You and
regards,
rev
--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/WiiMote-event-triggering-issue-tp7613407.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/