Sign in to follow this  

SDL - Event like WM_CHAR?

This topic is 4095 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

SDL has the ability to get the uncode value of the key pressed:


//Enable Unicode
SDL_EnableUNICODE( SDL_ENABLE );

//While there's events to handle
while( SDL_PollEvent( &event ) )
{

//If a key was pressed
if( event.type == SDL_KEYDOWN )
{

//If the key is a space
if( event.key.keysym.unicode == (Uint16)' ' )
{
//space was pressed
}

}

}



I have an example of it being used for text input here.

Share this post


Link to post
Share on other sites

This topic is 4095 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this