how to send more than one keystrokes at a time?

Discussion in 'Win32' started by imported_chrono, Sep 12, 2007.

  1. imported_chrono

    imported_chrono New Member

    Joined:
    Sep 7, 2007
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    if I wish to send three inputs(for example Ctrl,Alt,Z) from the keyboard, but at the same time, not one key after another, so what can I do?
     
  2. imported_chrono

    imported_chrono New Member

    Joined:
    Sep 7, 2007
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    question solved
     
  3. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
    Do you mind sharing how you did that? I guess its just plain simple postmessage.
     
  4. imported_chrono

    imported_chrono New Member

    Joined:
    Sep 7, 2007
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    Oh ok sure :)

    from codeproject website to send three keys Ctrl, Alt, and Z:
    keybd_event(VK_CONTROL, 0x9d, 0,0); //ctrl press
    keybd_event(VK_MENU, 0xb8, 0,0); //alt press
    keybd_event((BYTE)VkKeyScan('Z'), 0xac, 0,0); //Z press

    keybd_event(VK_CONTROL, 0x9d, KEYEVENTF_KEYUP,0); //ctrl release
    keybd_event(VK_MENU, 0xb8, KEYEVENTF_KEYUP,0); //alt release
    keybd_event((BYTE)VkKeyScan('Z'), 0xac, KEYEVENTF_KEYUP,0); //Z release
     
  5. imported_chrono

    imported_chrono New Member

    Joined:
    Sep 7, 2007
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    I didn't read carefully of your previous post, shabbir. To answer your post, no I didn't use PostMessage, but I did use the WM_COMMAND, where the user clicks on the button on the user interface then it will send out three keys input which I use keybd_event().
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice