CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2008
    Location
    San Francisco, USA
    Posts
    24

    [RESOLVED] virtual-key code VK_SHIFT question

    hello:
    when we press and hold the "shift" key, it generates the VK_SHIFT,and then i press "1" key,
    it generate character "!".
    what is going on in the wParam and lParam in this process?
    (sorry for my bad english)

    thanks! have a nice day!

  2. #2
    Join Date
    May 2009
    Posts
    3

    Re: virtual-key code VK_SHIFT question

    Whats the full code? I got something similar and found that :

    Numbers are either to be spoken to as VK_NUMPADX (where X is the representing number)
    OR
    I also noticed that A shift is to be generated to get the number in return.

    But apearently you are using another keyboard layout as i do.

    You happen to know where I find a full list of valid wVk numbers? i found one but lost it and the closest info i found again was that they are numbers from 1-256 or something..

  3. #3
    Join Date
    Jun 2008
    Location
    San Francisco, USA
    Posts
    24

    Re: virtual-key code VK_SHIFT question

    Quote Originally Posted by Komerad View Post
    Whats the full code? I got something similar and found that :

    Numbers are either to be spoken to as VK_NUMPADX (where X is the representing number)
    OR
    I also noticed that A shift is to be generated to get the number in return.

    But apearently you are using another keyboard layout as i do.

    You happen to know where I find a full list of valid wVk numbers? i found one but lost it and the closest info i found again was that they are numbers from 1-256 or something..

    just go to www.microsoft.com, and then type "virtual key code" to search, and you
    find the virtual key codes for WinCE and Windows.

    I hope this is helpful for you!Good luck!

  4. #4
    Join Date
    May 2009
    Posts
    3

    Re: virtual-key code VK_SHIFT question

    Thx, i was looking for a list like this one :
    http://www.indigorose.com/webhelp/am..._Key_Codes.htm

    Not good at changing hex to decimal. So having a list like that gives me an easy overview

  5. #5
    Join Date
    May 2009
    Posts
    3

    Re: virtual-key code VK_SHIFT question

    Anyone know the keycodes for % ^ [ ] ... ?

  6. #6
    Join Date
    Apr 2009
    Posts
    598

    Smile Re: virtual-key code VK_SHIFT question

    You can see the names and codes in winuser.h

    But there is no VK_xxx name for many keys. In that case (e.g. % ^ [ ]), you use the ascii code instead.

    By the way, beware that
    - special keys (F1, F2, up, down, insert) are usually tested in the code for the WM_KEYDOWN or WM_KEYUP message,
    - ordinary keys (A, B, %, [...) are usually tested in the code for the WM_CHAR message,
    - and other keys (shift, ctrl) are tested with GetKeyState().

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured