J'aurais besoin de deux bouton en plus merci
et surtout ou pourais-je trouve les plan de brochage
int InitJoystick(HWND JHWND)
//Initialisation
{
UINT uJoyID=JOYSTICKID1;
return joySetCapture(JHWND,uJoyID,15,true);
}
int CaptureJoystick (BOOL &Gauche,BOOL &Droite,int &Duree)
{
time_t debut, fin;
MMRESULT y=14;
UINT uJoyID=JOYSTICKID1;
LPJOYINFO pji = new JOYINFO();
Gauche = false;
Droite = false;
time (&debut);
do
{
y=joyGetPos(JOYSTICKID1, pji);
return y;
if (pji->wButtons==JOY_BUTTON1)
{
Droite = true;
}
if(pji->wButtons==JOY_BUTTON2)
{
Gauche = true;
}
} while ((pji->wButtons==JOY_BUTTON1) || (pji->wButtons==JOY_BUTTON2));
time (&fin);
Duree = (int) difftime (fin, debut);
}
void EtatJoy2k (BOOL &Gauche,BOOL &Droite)
//fonction identique à CaptureJoystick mais qui rensiegne sur l'etat du
//joystick et non sur le temps qu'il est resté enfoncé
//fonctionne uniquement sous win2000
{
MMRESULT y=14;
UINT uJoyID=JOYSTICKID1;
LPJOYINFO pji = new JOYINFO();
Gauche = false;
Droite = false;
y=joyGetPos(JOYSTICKID1, pji);
if (pji->wButtons==JOY_BUTTON1)
{
Droite = true;
}
if(pji->wButtons==JOY_BUTTON2)
{
Gauche = true;
}
}
int FermerJoystick(HWND JHWND)
{
UINT uJoyID=JOYSTICKID1;
return joyReleaseCapture(uJoyID);
}