SDL Event : Plusieur touche?

tekthomasdu96 Messages postés 303 Statut Membre -  
 DAEC -
Bonjour,

Comment avec SDL Event gerer plusieur toucher comme?
J'ai essayer "case SDLK_LEFT + SDLK_UP :" mais ca na pas l'air de marcher...

Quelq'un pourait m'aider SVP?
--
?*µ¤m@$

2 réponses

  1. ...
     
    Essaye plutôt ça : "case SDLK_LEFT | SDLK_UP:"
    0
  2. DAEC
     
    On peut faire :
    int touche_haut=0, touche_gauche=0;
    ...
    Puis, dans te boucle :
    sdl_WaitEvent(&event);
    switch(event.type)
    {
    case SDL_KEYDOWN:
    switch(event.key.keysym.sym)
    {
    case SDLK_LEFT:
    touche_gauche++;
    break;

    case SDLK_UP:
    touche_haut++;
    break;
    }
    break;

    case SDL_KEYUP:
    switch(event.key.keysym.sym)
    {
    case SDLK_LEFT:
    touche_gauche--;
    break;

    case SDLK_UP:
    touche_haut--;
    break;
    }
    break;
    }

    if(touche_haut==1 && touche_gauche==1)
    {
    //tes instructions
    }
    0