PDA

View Full Version : Keyboard Input



technomage
02-10-2005, 01:49 PM
Anyone know how to read keyboard combinations in SDL? For example
what is the best way to detect ALT+F4 or [Shift]+A.

WILL
02-10-2005, 05:42 PM
I think combination detection is up to the programmer(you). :)

SDL has awesome input features, though. You can practically tell what key has been pressed and unpressed in a queue. So if you make an object with methods or simple array of each key you want to track, you can use this to check for combinations where input control is required.

I use this aproach in all my games. If you look up my latest game project, you'll see how I do it with my own Keymap System.