Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Ranok

Scan Codes to Characters?

This topic is 6913 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

We discuessed this a couple weeks ago, but here is the summary:

1) Use WM_CHAR messages (assuming not in exclusive keyboard mode) and ignore DirectInput scan codes for purpose of text.

2) Calculate a conversion array with the scan code as the index and the ASCII code as the result. Also, caluclate a "shifted" array for when the SHIFT or CAPS LOCK keys are down.

In other words, no real simple way. I prefer the second way because I program for portability and my input layer is already abstracted out, so this just lies on top and is not affected by what platform I am on.

- Splat

Share this post


Link to post
Share on other sites
Advertisement
Does anybody know a good way to convert from a characters scan code to the character itself ie. I have the scan code DIK_A how can I get the character 'a' from it besides using a huge switch statement or something like that?

Share this post


Link to post
Share on other sites
Perhaps, if you tied this DI subject into writing your own DirectX console
(e.g. typing out a message for network players), making a game load/save menu
where you have to type the name of the file to save it, or creating a top
score list where you type in your name, I would love to read. The last one on
quake-like consoles was not very helpful, (not to me anyway ) since it was
written in Visual Basic and did not use a DI scan codes to ascii codes method.

Reaver

[This message has been edited by Reaver (edited November 12, 1999).]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!