+
+ /*
+ * Emulate a digital joystick.
+ */
+ if(_up && (_y > -threshold())){
+ setUp(false);
+ }else if(!_up && (_y < -threshold())){
+ setUp(true);
+ }
+
+ if(_down && (_y < threshold())){
+ setDown(false);
+ }else if(!_down && (_y > threshold())){
+ setDown(true);
+ }
+
+ if(_left && (_x > -threshold())){
+ setLeft(false);
+ }else if(!_left && (_x < -threshold())){
+ setLeft(true);
+ }
+
+ if(_right && (_x < threshold())){
+ setRight(false);
+ }else if(!_right && (_x > threshold())){
+ setRight(true);
+ }
+ }else if(data.at(0) == 8){