TrevorBradley
Active Member
- Joined
- Nov 6, 2007
- Messages
- 732
I've started to add chat to my game, and started to hit a major headache.
EDIT: Should have mentioned I'm using C++/SDL, if anyone wasn't following along.
When I was checking for individual keys, using SDL Keydown events worked just fine. But now that I'm looking to use the entire keyboard for text chat, it looks like a nightmare.
I actually went through and did it the dumb way, checking for individual keys, combinations of shifts, and translated the event.key.keysym.mod into a char. But some of my users use international keyboards and all my hack work seems like twice the waste now.
I'm wondering if there's a platform independent way of pulling in keyboard input to get characters that doesn't block.
Alternately if there's no easy non-blocking solution and I decide to run "cin" to pull keyboard input in a different thread (probably should have done this in the first place), how well does it work for foreign characters?
Thanks in advance!
EDIT: Should have mentioned I'm using C++/SDL, if anyone wasn't following along.
When I was checking for individual keys, using SDL Keydown events worked just fine. But now that I'm looking to use the entire keyboard for text chat, it looks like a nightmare.
I actually went through and did it the dumb way, checking for individual keys, combinations of shifts, and translated the event.key.keysym.mod into a char. But some of my users use international keyboards and all my hack work seems like twice the waste now.
I'm wondering if there's a platform independent way of pulling in keyboard input to get characters that doesn't block.
Alternately if there's no easy non-blocking solution and I decide to run "cin" to pull keyboard input in a different thread (probably should have done this in the first place), how well does it work for foreign characters?
Thanks in advance!