En ce momentGenshin ImpactValhallaBreath of the wildAnimal CrossingGTA 5Red dead 2
Liste des sujets
dicerner clic gauche et clic droit
Perdu_de_linfo
Niveau 9
13 mars 2005 à 12:41:44
Hello,
voila, presque tout est dans le titre: j´aimerais effectuer deux opérations différentes selon si la personne fais un clic gauche ou un clic droit. Merci
P.S. en c++
delf__ar
Niveau 7
13 mars 2005 à 12:43:07
avec quoi? openGL, sdl?
Perdu_de_linfo
Niveau 9
13 mars 2005 à 12:44:56
SDL_MOUSEBUTTONDOWN ^^
jejej
Niveau 9
13 mars 2005 à 12:59:54
case SDL_MOUSEBUTTONDOWN: if ( event.button.button==SDL_BUTTON_LEFT) { / / fait qqchose } if( event.button.button==SDL_BUTTON_RIGHT) { / / fait autre chose }
Perdu_de_linfo
Niveau 9
13 mars 2005 à 13:05:56
Merci
dnob700
Niveau 10
13 mars 2005 à 15:41:13
c´est plus propre avec un autre switch quand même.
il faudrait toujours préféré les switch aux if, dès qu´il y a plus d´une possibilité ( et que bien sur le test s´y prete).