Armkreuz_Spiderz
Messages postés61Date d'inscriptionmercredi 23 juin 2004StatutMembreDernière intervention27 décembre 2008
-
19 août 2004 à 13:47
jex03
Messages postés1Date d'inscriptiondimanche 21 janvier 2007StatutMembreDernière intervention 4 février 2010
-
4 févr. 2010 à 14:38
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.
jex03
Messages postés1Date d'inscriptiondimanche 21 janvier 2007StatutMembreDernière intervention 4 février 2010 4 févr. 2010 à 14:38
bonjour , je suis newbie en prog, ce code m'intéresse mais je ne sais pas du tout comment exploiter les fichier mis a dispositions.Si quelqu'un peut me donner un coup de pouce ! merci
cs_costello
Messages postés136Date d'inscriptionlundi 2 septembre 2002StatutMembreDernière intervention15 février 2006 28 mars 2007 à 00:08
malheureusement ce code ne passe pas avec une manette XBOX 360 (branchée en USB)
la manette fonctionne normalement dans les jeux.
cs_grandvizir
Messages postés1106Date d'inscriptionsamedi 8 novembre 2003StatutMembreDernière intervention 3 septembre 200622 31 août 2005 à 14:45
Pour un mode en position absolue, voici un bout de code tiré des travaux de Armkreuz_Spiderz :
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if RadioButton1.Checked then JoyID:=JOYSTICKID1
else JoyID:=JOYSTICKID2;
InfoJoystick.dwSize:=SizeOf(InfoJoystick);
InfoJoystick.dwFlags:= JOY_RETURNALL;
Result := joyGetPosEx(JoyID, @InfoJoystick);
GetCursorPos(mousept);
SetCursorPos(Screen.Width * InfoJoystick.wXpos div 65535, Screen.Height * InfoJoystick.wYpos div 65535);
case InfoJoystick.wButtons of
JOY_BUTTON1:
begin
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
end;
JOY_BUTTON2:
begin
mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
end
end;
end;
Par contre, le clic sur le joystick est double :(
Armkreuz_Spiderz
Messages postés61Date d'inscriptionmercredi 23 juin 2004StatutMembreDernière intervention27 décembre 2008 19 août 2004 à 13:51
...
Armkreuz_Spiderz
Messages postés61Date d'inscriptionmercredi 23 juin 2004StatutMembreDernière intervention27 décembre 2008 19 août 2004 à 13:47
4 févr. 2010 à 14:38
28 mars 2007 à 00:08
la manette fonctionne normalement dans les jeux.
31 août 2005 à 14:45
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if RadioButton1.Checked then JoyID:=JOYSTICKID1
else JoyID:=JOYSTICKID2;
InfoJoystick.dwSize:=SizeOf(InfoJoystick);
InfoJoystick.dwFlags:= JOY_RETURNALL;
Result := joyGetPosEx(JoyID, @InfoJoystick);
GetCursorPos(mousept);
mouseXlabel.Caption := FloatToStr(mousept.X);
mouseYlabel.Caption := FloatToStr(mousept.Y);
joyXlabel.Caption := IntToStr(InfoJoystick.wXpos);
joyYlabel.Caption := IntToStr(Infojoystick.wYpos);
SetCursorPos(Screen.Width * InfoJoystick.wXpos div 65535, Screen.Height * InfoJoystick.wYpos div 65535);
case InfoJoystick.wButtons of
JOY_BUTTON1:
begin
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
end;
JOY_BUTTON2:
begin
mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
end
end;
end;
Par contre, le clic sur le joystick est double :(
19 août 2004 à 13:51
19 août 2004 à 13:47