Newbie and the keyboard :)

YOU’LL UNDERSTAND MY QUESTION !!!

So, i’ve just begun to use SDL and my problem is that i’m looking for an
esay way to know if a user pressed the arrows of the keyboard in my
switch/case of my main function !!
Like
switch(…)
case VK_LEFT:
break
case VK_DOWN:

… I know that it’s existing in DirextX but i want to know it with SDL
because i could do it under Linux and Windows… understand !!! :)))

And so how to move a draw on the screen by pressing without releasing
???

So thanks for those who first understand and those who reply !!!

Ciao

" Sylvain.Hellegouarch + etud.sir.a1" wrote:

YOU’LL UNDERSTAND MY QUESTION !!!

So, i’ve just begun to use SDL and my problem is that i’m looking for an
esay way to know if a user pressed the arrows of the keyboard in my
switch/case of my main function !!
Like
switch(…)
case VK_LEFT:
break
case VK_DOWN:

Try something like this:

switch(…) {
case SDLK_LEFT:
break;
case SDLK_DOWN:
/* blah blah blah */
}

For a complete list of the keysyms that SDL uses, RTFM. It’s in there
somewhere. Or else try looking at /usr/local/include/SDL/SDL_keysym.h
(assuming you installed SDL in /usr/local) if for some reason you don’t
have the manuals in your distribution or have no easy way of looking at
them on Sam’s site at devolution.–

| Rafael R. Sevilla @Rafael_R_Sevilla |
| Instrumentation, Robotics, and Control Laboratory |

College of Engineering, University of the Philippines, Diliman

I use a function that tell me if a key has been pressed, it should be easy
to modify it to accomplish to your needs. Take a look at
http://come.to/arianne_rpg
Go to download and download the last version, 0.2.4, I think.

I hope this help you.
Miguel Angel Blanch Lardin
http://come.to/arianne_rpg

Sylvain.Hellegouarch + etud.sir.a1 escribi?:> YOU’LL UNDERSTAND MY QUESTION !!!

So, i’ve just begun to use SDL and my problem is that i’m looking for an
esay way to know if a user pressed the arrows of the keyboard in my
switch/case of my main function !!
Like
switch(…)
case VK_LEFT:
break
case VK_DOWN:

… I know that it’s existing in DirextX but i want to know it with SDL
because i could do it under Linux and Windows… understand !!! :)))

And so how to move a draw on the screen by pressing without releasing
???

So thanks for those who first understand and those who reply !!!

Ciao