Very very quick virtual key Question???

Started by
7 comments, last by Manolis 19 years, 7 months ago
Im trying to find the virtual keys for backslash frontslash and the period key. These is an article writen by Jeff Molofee called MSDN Virtual-Key Codes in this article these keys are listed but I think they are Windows 2000 specific Im using Windows XP and they dont work! snif what are the keys i need? Thanx Manolis
Advertisement
[google]: virtual key codes

http://www.google.com/search?q=virtual+key+codes&sourceid=firefox&start=0&start=0&ie=utf-8&oe=utf-8

-me
OK Maybe the problem is something else.... I use VK_OEM_PERIOD for '.' But I get this compilation error:

error C2065: 'VK_OEM_PERIOD' : undeclared identifier

Im I missing out a header file or something?
I'm prettu sure the virtual keycode for everything in the ascii set is the same as the ascii code. Try '.'
Ummm yea I tryed it buy it dosent work ether!

Thanx guys for helping by the way...
Very mutch apresiated...
No they're not the same as the ascii characters. But they're just VK_PERIOD, VK_SLASH, and VK_BACKSLASH. The values are 0x34, 0x35, and 0x2B, respectively.

Oh wait, those are the keys for DirectInput, but I'm pretty sure they're the same as the VK codes.
~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
From my VC7.0 docs (2k2 version) it refers to all of the DirectX virtual key codes as being prepended with the characters 'DIK_' rather than 'VK_' like the win32 ones.

The VK codes for period only seems to be available as an oem key code as follows-> (excerpt from msdn docs)

SYMBOL: VK_OEM_PERIOD
HEXCODE: BE
Keyboard equiv: Windows 2000/XP: For any country/region, the '.' key

I'm not sure what this means for non 2K or XP users but you can always try.

ps. sometimes a definition is required for some macros/contants, i'm not sure what this would be (couldn't find anything that said a #define would be required) but you can always just have a peek at the header file and find out for yourself if nessesary.
hmm...my browser just doesn't want to leave me logged in today it seems:P (my post above that is)

edit: ...oops...didn't read one of your posts well enough, VK_OEM_PERIOD is the correct key code, the #include you'll need is windows.h which will then include winuser.h, don't inlude winuser.h directly however!

Enjoy!
Unfortunetly I know its the right key and I also do have windows.h #included but it still dosent work! ITs a big mistery... I have tryed everything but the sily period key does not want to work!

This topic is closed to new replies.

Advertisement