[SDL] Numeric Keyboard

Romi Kuntsman romik12345 at lycos.co.uk
Sat Jul 13 12:56:01 PDT 2002


Bruno Martínez wrote:

>Hi:
>I'm programming a BangBang clone, so I need to ask the user the angle and speed. However, I can't make 
>the numeric keyboard work. Here's a fragment of code about what I'm trying to achieve:
>
>case SDL_KEYDOWN:
>	char ch;
>	if ( (event.key.keysym.unicode & 0xFF80) == 0 ) {
>		ch = event.key.keysym.unicode & 0x7F;
>		cout << ch;
>		if(isdigit(ch))
>			MessageBeep(0);
>	}
>It beeps with the numbers over the letter keys, but it doesn't with the rightmost numbers. Unicode 
>translation is ON, NumLock doesn't make a difference and the sym path (assuming ascii) doesn't work 
>either. 
>
>Thanks, Bruno Martínez
>  
>

Which characters DOES it return when you press the numpad keys?

RK.






More information about the SDL mailing list