Virtual keycode for backslash key
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Virtual keycode for backslash key

  1. #1
    Join Date
    Jan 2011
    Posts
    101

    Virtual keycode for backslash key

    Witch is virtual keycode for backslash (key near enter/return)?
    This does not work:

    Code:
    case VK_OEM_102:
    {
            // keyboard = RAWKEYBOARD
    	if(keyboard.Flags & RI_KEY_BREAK)//key up
    	{
    		keysUp[KEY_BACKSLASH] = true;
    		keysPressed[KEY_BACKSLASH] = false;
    	}
    	else
    	{
    		keysPressed[KEY_BACKSLASH] = true;
    	}
    }break;

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,419

    Re: Virtual keycode for backslash key

    1. Virtual keycode for backslash (ор the angle bracket) key is 0xЕ2 (VK_OEM_102)

    2. What does not work in the code snippet you have posted? Where is this code executed?
    Victor Nijegorodov

  3. #3
    Join Date
    Jan 2011
    Posts
    101

    Re: Virtual keycode for backslash key

    I am not sure witch type is my keyboard. If i seen correctly i got only one (\) backslash key on it (with shift key its (|) "bar").
    I 've used exact code for other keys and it works (displaying some text if certain key is pressed) except for some of them. so far i can't get these keys (code is still WIP so i am yet to discover others i need that not work):
    \ - backslash
    / - slash
    ; - semicolon
    Thanks for your time.

  4. #4
    Join Date
    Jan 2011
    Posts
    101

    Re: Virtual keycode for backslash key

    Solved.
    I set code to print me v. keycodes for pressed keys that was not worked.
    I got backslash as 220 (0xDC) and in documentaion it said its VK_OEM_5.

  5. #5
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,419

    Re: Virtual keycode for backslash key

    In my old MSDN from October 2000:
    VK_OEM_5
    DC
    Windows 2000: For the US standard keyboard, the '\|' key
    Victor Nijegorodov

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

This is a CodeGuru survey question.


Featured


HTML5 Development Center