DirectInput Language Option

Started by
2 comments, last by Daivuk 18 years, 6 months ago
Hi In my engine i'm using DirectInput for my keyboard entries. But when writing text, directInput interpret it always in English keyboard. But not all the people configure their keyboard in english, so I want my engine to adapt to the user windows language configuration. I read in msdn that DI doesnt have any function for translation and will always interpret it in english. But if we take a game like : Counter Strike Source If I change my keyboard configuration (Canadian Multilingue for exemple), it will change in the game too. But they are probably using DI (since source engine is DX powered) So is there exist any function or librairy that can take the DI input key and translate it OR the inverse.?? Thanks for help!
Advertisement
DirectInput basically treats the keyboard as a controller with many buttons. It doesn't know them as 'keys' and it associates no language to them. Rather, it is meant for reading the scan-codes being generated. These scan-code basically just contain two values: One for the button pressed and one for the state of that button (up or down).

That being said, you shouldn't use DirectInput for text. Use Windows messages instead.
Quote:Original post by lack o comments
That being said, you shouldn't use DirectInput for text. Use Windows messages instead.

Specifically, the WM_CHAR message is great for text input. It handles all of the stuff that you need, including different charsets, shifting/caps-lock, key repeating, ect...
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
Nice thanks!!

So I will use DI for my game input, and use WM_CHAR for text input :)

This topic is closed to new replies.

Advertisement