Thread: Virtual Keys :: MFC

  1. #1
    Registered User
    Join Date
    Nov 2001

    Virtual Keys :: MFC


    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.


  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    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, 03:45 AM
  2. MFC Assertion Failure
    By maxthecat in forum Windows Programming
    Replies: 5
    Last Post: 08-01-2002, 09:58 AM
  3. WIndows programming?
    By hostensteffa in forum Windows Programming
    Replies: 7
    Last Post: 06-07-2002, 08: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, 01:26 PM