CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Virtual Key Code for VK_DECIMAL

  1. #1
    Join Date
    Dec 2003

    Virtual Key Code for VK_DECIMAL

    Hi all. I am trying to test for the decimal/period key '.' in my OnChar function. I looked up the MSDN Virtual Key code for this and it said it is 110, which is a lower case 'n'. The only way I can get this to work is if I test for VK_DELETE instead of VK_DECIMAL. If I enter the decimal point and print its integer value it is 46. Does anybody know what's going on?

    if (nChar == VK_DECIMAL) // simply does not work!

    Why would MSDN publish Virtual Key codes that do not work since they are incorrect? How can they say the integer value of a decimal point is 110, everybody knows this is ASCII for lower case 'n'? Please help!

  2. #2
    Join Date
    May 2002
    Hi mate,
    VK_DECIMAL would refer to the DEL key on the numpad.
    This will work in tandom with the NUM LOCK.
    If you need to trap the "." key of the normal keyboard, then you will need to use the corresponding hex value which is 0x2E.
    Life is short, enjoy it with a smile as long as it lasts.
    User error. Replace User and press any key when ready. - Anonymous

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)