View Single Post
  #5   Spotlight this post!  
Unread 11-09-2012, 19:53
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Reading multiple joysticks on C# using SlimDX.

First, shouldn't that be a comma after Input you the code you posted. If that's just a typo when copying to CD, there's probably a problem on the line before or after it.

Second, you should do that with a single timer. Something like:

Code:
Joystick[] sticks;
void init() {//pageload, or new, or something similar
  Sticks = GetSticks();//using my code from previous post
}
void TimerHandler (...){
  for (int i = 0; i < sticks.Length; i++){
    StickHandlingLogic(sticks[i], i); //replace the identifier with something meaningful to your application.
  }
}
void StickhandlingLogic(Joystick stick, int id) { //pass the stick and some type of identifier, since you want to know which users stick this is
  //Process the joystick data here
}
__________________
Eric Haskins KC9JVH