简体   繁体   中英

How to control led from several keyboard separated

Now I'm doing a project.

There are several keyboards connect to the computer. I use keybd_event() to control the led, but when I turn on the led (such as numlock led), the numlock led of all the keyboard will turn on too.

I want to control led separated, that mean when I turn on the led of one keyboard, the corresponding led of rest keyboard will not turn on.

I do this in C#. Does anyone have any idea?

With IBMPC keyboards (and Mac, I think), keyboard state is maintained at the operating system device driver level. The hardware in the keyboard itself just tells the system which keys are pressed or released, and the driver translates that into characters actually typed. As a result, there really isn't any ability to have different keyboards in different states, and the LEDs should display the same state for all keyboards.

You MAY be able to change that behavior if you're willing to write your own USB device drivers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM