Results 1 to 4 of 4

Thread: GetAsyncKeyState and special keys

  1. #1
    Join Date
    Jan 2009
    Posts
    150

    GetAsyncKeyState and special keys

    I have created a C++ program in which GetAsyncKeyState function retrieves the keys with the line.

    With the help of this program, I can recover the classical keys (0-9, a-z, ctrl, enter, space, etc ...), but I can not retrieve the keys "," ";" ":" "!" "^" ")" "=" and other special keys with this function.

    For example for "," I tried VK_COMMA, but nothing is detected.

    Can you help me to solve this problem?

  2. #2
    Join Date
    Apr 2008
    Posts
    2,005

    Re: GetAsyncKeyState and special keys

    Have you tried with VkKeyScanEx function? The VkKeyScanEx function translates a character to the corresponding virtual-key code and shift state. The function translates the character using the input language and physical keyboard layout identified by the input local identifier.

    Syntax:
    Code:
    SHORT VkKeyScanEx(      
        TCHAR ch,
        HKL dwhkl
    );
    where,
    ch: Specifies the character to be translated into a virtual-key code.
    dwhkl: Inputs local identifier used to translate the character. This parameter can be any input local identifier previously returned by the LoadKeyboardLayout function.

  3. #3
    Join Date
    Jan 2009
    Posts
    150

    Re: GetAsyncKeyState and special keys

    I tried it, but this function seems to only convert a character in his Scancode and does not allow me to identify in support of a key

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: GetAsyncKeyState and special keys

    No, but it allows you to get the Scancode you want to test. So, you just need to combine the two.

Similar Threads

  1. Replies: 3
    Last Post: 07-03-2011, 01:17 AM
  2. Replies: 4
    Last Post: 05-02-2011, 08:37 AM
  3. What are the shortcut keys for Special Character
    By Santy in forum Customize Desktop
    Replies: 4
    Last Post: 25-06-2009, 06:55 PM
  4. Replies: 1
    Last Post: 24-03-2009, 05:29 PM
  5. Keys for Special Symbols in Windows
    By Fleming in forum Tips & Tweaks
    Replies: 1
    Last Post: 06-11-2008, 06:29 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,001,673.68265 seconds with 16 queries