Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get inputs from specific keyboard (USB port) just in my APP even when its not focused

Tags:

c#

winforms

The situation :

I have two Keyboards connected to a single computer (both with USB cable).

Two problems :

  1. How can I get keyboard inputs when my application is not focused
  2. Get all inputs from specific keyboard and block its inputs for other applications.

I want two Users to work with one Computer with two Keyboards, one works just with my application, with one specific Keyboard and another user, can use the other Keyboard while working with the other software. Keyboard ports never changes. is it possible friends ? and how can i do that?

like image 622
hamze Avatar asked Jun 29 '13 08:06

hamze


People also ask

Why is my computer not recognizing my USB keyboard?

Check for hardware problems Verify the keyboard is plugged in securely. Disconnect the keyboard from the computer and reconnect it to the same port. If you have a USB keyboard, you may also want to try a different USB port to isolate the issue.

Why did my USB ports suddenly stop working?

Power management settings in your computer may be disrupting your USB ports. USB Selective Suspend can deactivate a USB port when not in use in order to save battery life, but can also sometimes disable the port when you're trying to use it. When this happens, you can go into Power Options and turn off the setting.


1 Answers

http://www.codeproject.com/Articles/17123/Using-Raw-Input-from-C-to-handle-multiple-keyboard

I used this for a project a while back, this should do it.

like image 102
Malcor Avatar answered Sep 23 '22 23:09

Malcor