Virtual Keys :: MFC

This is a discussion on Virtual Keys :: MFC within the C++ Programming forums, part of the General Programming Boards category; Hi. I would like to know how to determine when the user presses, say, 'z' *while* holding down one of ...

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348

    Virtual Keys :: MFC

    Hi.

    I would like to know how to determine when the user presses, say, 'z' *while* holding down one of the virtual keys, say Ctrl.

    For example

    // Ctrl + Z

    I can use either OnKeyDown(...) and/or OnChar(...) to determine *either* Ctrl or z, but not both.

    I am trying to implement an "undo" feature.

    Thanks,
    Kuphryn

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    I guess you could start your OnChar handler with a call to the api function GetAsyncKeyState()........and specify VK_CONTROL..

    I havent tested it...but I think it would work

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 48
    Last Post: 09-26-2008, 04:45 AM
  2. MFC Assertion Failure
    By maxthecat in forum Windows Programming
    Replies: 5
    Last Post: 08-01-2002, 10:58 AM
  3. WIndows programming?
    By hostensteffa in forum Windows Programming
    Replies: 7
    Last Post: 06-07-2002, 09:52 PM
  4. C++ XML Class
    By edwardtisdale in forum C++ Programming
    Replies: 0
    Last Post: 12-10-2001, 11:14 PM
  5. Exporting Object Hierarchies from a DLL
    By andy668 in forum C++ Programming
    Replies: 0
    Last Post: 10-20-2001, 02:26 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21