I have a proprietary device - something like an iPad screen - which has a front panel display with touchscreen buttons that work internally as a USB keyboard. During testing/debugging I want to connect it to another keyboard via the external USB port.

Any application which I open on the device by pressing some characters on the touchscreen accepts input codes from either USB keyboard. I want to limit the touchscreen USB keyboard input only to a specific set of apps.

Is there a program which can help me detect which USB port or device the code is coming from? Or someway I can map one keyboard to send a different set of codes? The device is using Linux.

link|improve this question
feedback

migrated from stackoverflow.com Jun 24 '11 at 12:04

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 2 down vote accepted

There will be a device node /dev/input/eventX (where X is some integer index) for that usb input device (if it is recognized as a HID device with keys). That node will emit event structures when you read from it.

If you are running X with the evdev input device it will be automatically combined with other inputs and you won't be able to separate the events from it, by default. With some careful evdev filter configuration in xorg.conf you can probably inhibit that.

Unfortunately I don't have time to do all that for you, but I hope that gets you in the right direction.

link|improve this answer
feedback

I don't think this is something that you can do at an application level as the device drivers should all be packages inside of the kernel, providing streams (tty/pty in linux?) to be consumed by processes.

link|improve this answer
device is running linux – John Qualis Jun 24 '11 at 8:32
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.