Jump to content
  • Advertisement
Sign in to follow this  
Manolis

Very very quick virtual key Question???

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

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

Share this post


Link to post
Share on other sites
Advertisement
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?

Share this post


Link to post
Share on other sites
I'm prettu sure the virtual keycode for everything in the ascii set is the same as the ascii code. Try '.'

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!