Game Programming and Development Tools

DInput Question – Mike

Mike
Member

Posts: 11
From: Woodbury, MN, USA
Registered: 06-28-2001
I'm trying to rewrite my (very old) input module for my latest engine, and I'm using Direct Input. My question is whether or not Direct Input has an easy way to get ASCII data or not. As far as I know, it doesn't, but then again, I'm not too knowledgable on the topic. If it doesn't, I have at least two choices. On one hand, I could use the Windows call back function, and get data that way. However, that would not be ideal for the project. On the other hand, I could write my own map that does all of the characters. This wouldn't be terribly hard to do, but maybe there's an easier way?

Any help would be appreciated, and thanks again.
Mike

Briant

Member

Posts: 742
From: Stony Plain, Alberta, Canada
Registered: 01-20-2001
You are right about DInput not having a direct way to get ASCII codes (although I haven't looked at DX8 yet).

VK_0 to VK_9 and VK_A to VK_Z are not defined, but I think that is because they would already be equal to their associated ascii codes (0x30 - 0x39 and 0x41 - 0x5A). Note that this doesn't apply to other ASCII characters, such as punctuation, etc.

Either using the call back or making your own mapping function are both fairly simple, and you can use either method.

------------------

Mike
Member

Posts: 11
From: Woodbury, MN, USA
Registered: 06-28-2001

You are correct that the VK_A though VK_Z and VK_0 through VK_9 are the ASCII character keys. I think that's the straight windows virtual key codes, though, and direct input uses the DIK_Something name conventions. Anyway, thanks for responding, and I worked around some things and just implemented the call back method. It took only 10 to 15 minutes for that whole part of the module, so it wasn't too bad .