Thread: Using Windows Virtual Keys

  1. #1
    Registered User IdioticCreation's Avatar
    Join Date
    Nov 2006
    Location
    Lurking about
    Posts
    229

    Using Windows Virtual Keys

    Hey,

    I can't figure out how you would use the vk's to get a common short cut, like ctrl+v. The virtual key for control is just VK_CONTROL, but letters don't have vk's. Should I be doing this a different way?

    Thanks

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    It just so happens that the virtual key codes for 0 - 9 and A - Z correspond to their ASCII codes.

    0 --> '0' = 0x30
    1 --> '1' = 0x31
    ...
    A --> 'A' = 0x41
    B --> 'B' = 0x42
    ...

    If for example it's an edit control, it's window procedure will recieve messages like WM_PASTE, WM_CUT, WM_UNDO. There are also keyboard accelerators which are like 'shortcuts' http://msdn2.microsoft.com/en-us/library/ms645526.aspx

  3. #3
    Registered User IdioticCreation's Avatar
    Join Date
    Nov 2006
    Location
    Lurking about
    Posts
    229
    Thanks, your very helpful you know that.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Virtual Keys
    By silentkarma in forum Windows Programming
    Replies: 2
    Last Post: 09-15-2006, 05:19 PM
  2. abstract class
    By xddxogm3 in forum C++ Programming
    Replies: 5
    Last Post: 01-01-2005, 09:08 AM
  3. virtual keys, while loop, movement
    By PHP in forum C++ Programming
    Replies: 3
    Last Post: 12-24-2002, 02:57 PM
  4. How do you toggle keys like Scroll lock without Windows API?
    By animeaholic in forum C++ Programming
    Replies: 7
    Last Post: 09-15-2002, 07:02 PM
  5. Exporting Object Hierarchies from a DLL
    By andy668 in forum C++ Programming
    Replies: 0
    Last Post: 10-20-2001, 01:26 PM