Call the keybd_event function of the User32.dll library in C # to manipulate the keyboard

Source: Internet
Author: User
Tags bit set

The function prototypes for keybd_event() are:

void Keybd_event (

Byte bvk, //Virtual key code

Byte bscan, //Hardware scan code for the key

DWORD DwFlags //A flag bit set for various aspects of the function operation

DWORD dwExtraInfo //Additional 32-bit value associated with a keystroke

);

There are three types of values for the third parameter:

· 0: Press the

· 1: Extension key

· 2: Pop Up

Keybd_event (0x41, 0x1e, 0x0000, 0);   Press Akeybd_event (0x41, 0x1e, 0x0002, 0);   Bounce Up Akeybd_event (0x42, 0x30, 0x0000, 0);   Press Bkeybd_event (0x42, 0x30, 0x0002, 0);   Bounce Up Bkeybd_event (0x43, 0x2e, 0x0000, 0);   Press Ckeybd_event (0x43, 0x2e, 0x0002, 0);   Bounce Up Ckeybd_event (0x43, 0x2e, 0x0000, 0);   Press Ckeybd_event (0x43, 0x2e, 0x0002, 0);   Pop up C

  

Call the keybd_event function of the User32.dll library in C # to manipulate the keyboard

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.