* How do you keep input from a USB Mag card reader from going to STDIN?
@ 2009-06-10 19:40 Mark Butsch
2009-06-23 14:02 ` Jiri Kosina
0 siblings, 1 reply; 4+ messages in thread
From: Mark Butsch @ 2009-06-10 19:40 UTC (permalink / raw)
To: 'linux-input@vger.kernel.org'
Hello,
I hope this is the correct place to post this.
I have both a USB keyboard and a USB Mag card reader (that works like a USB keyboard) connected to my system.
I would like to make it so the real keyboard is the only device that feeds STDIN and the mag card reader is only readable by reading that device directly.
If I "cat /proc/bus/input/devices" it shows:
I: Bus=0003 Vendor=04da Product=117c Version=0001
N: Name="Panasonic Panasonic USB keyboard compliant Mag-CR"
P: Phys=usb-0000:00:1d.3-1/input0
S: Sysfs=/class/input/input37
H: Handlers=kbd event5
B: EV=120003
B: KEY=10000 7 ff80007a 7ff febeffdf ffefffff ffffffff fffffffe
B: LED=1f
I: Bus=0003 Vendor=413c Product=2105 Version=0352
N: Name="Dell Dell USB Keyboard"
P: Phys=usb-0000:00:1d.0-1/input0
S: Sysfs=/class/input/input38
H: Handlers=kbd event2
B: EV=120003
B: KEY=10000 7 ff87207a c14057ff febeffdf ffefffff ffffffff fffffffe
B: LED=7
How would I disconnect the "kbd" handler from the mag card reader (and the mag card reader from the "kbd" handler) or is that the wrong approach?
Thanks in advance.
Mark Butsch
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How do you keep input from a USB Mag card reader from going to STDIN?
2009-06-10 19:40 How do you keep input from a USB Mag card reader from going to STDIN? Mark Butsch
@ 2009-06-23 14:02 ` Jiri Kosina
2009-06-23 14:19 ` Janusz Krzysztofik
0 siblings, 1 reply; 4+ messages in thread
From: Jiri Kosina @ 2009-06-23 14:02 UTC (permalink / raw)
To: Mark Butsch; +Cc: 'linux-input@vger.kernel.org'
On Wed, 10 Jun 2009, Mark Butsch wrote:
> I would like to make it so the real keyboard is the only device that
> feeds STDIN and the mag card reader is only readable by reading that
> device directly.
>
> If I "cat /proc/bus/input/devices" it shows:
>
> I: Bus=0003 Vendor=04da Product=117c Version=0001
> N: Name="Panasonic Panasonic USB keyboard compliant Mag-CR"
> P: Phys=usb-0000:00:1d.3-1/input0
> S: Sysfs=/class/input/input37
> H: Handlers=kbd event5
> B: EV=120003
> B: KEY=10000 7 ff80007a 7ff febeffdf ffefffff ffffffff fffffffe
> B: LED=1f
>
> I: Bus=0003 Vendor=413c Product=2105 Version=0352
> N: Name="Dell Dell USB Keyboard"
> P: Phys=usb-0000:00:1d.0-1/input0
> S: Sysfs=/class/input/input38
> H: Handlers=kbd event2
> B: EV=120003
> B: KEY=10000 7 ff87207a c14057ff febeffdf ffefffff ffffffff fffffffe
> B: LED=7
>
> How would I disconnect the "kbd" handler from the mag card reader (and
> the mag card reader from the "kbd" handler) or is that the wrong
> approach?
You can either unbind HID driver from the device completely, and write
your own userspace driver using libusb.
Or you can patch the HID driver not to attach this device to inpu
subsystem, and only trigger creation of /dev/hidraw (or /dev/hiddev
respectively), and write user-space application that will process the HID
events from these device nodes, and process them in your application as
needed.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How do you keep input from a USB Mag card reader from going to STDIN?
2009-06-23 14:02 ` Jiri Kosina
@ 2009-06-23 14:19 ` Janusz Krzysztofik
2009-06-23 14:22 ` Jiri Kosina
0 siblings, 1 reply; 4+ messages in thread
From: Janusz Krzysztofik @ 2009-06-23 14:19 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Mark Butsch, 'linux-input@vger.kernel.org'
Jiri Kosina wrote:
> On Wed, 10 Jun 2009, Mark Butsch wrote:
>> How would I disconnect the "kbd" handler from the mag card reader (and
>> the mag card reader from the "kbd" handler) or is that the wrong
>> approach?
>
> You can either unbind HID driver from the device completely, and write
> your own userspace driver using libusb.
>
> Or you can patch the HID driver not to attach this device to inpu
> subsystem, and only trigger creation of /dev/hidraw (or /dev/hiddev
> respectively), and write user-space application that will process the HID
> events from these device nodes, and process them in your application as
> needed.
I thouhgt this could be done from userspace without any kernel
modification, just the way "input-events -g" does it. Am I missing anything?
Janusz
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How do you keep input from a USB Mag card reader from going to STDIN?
2009-06-23 14:19 ` Janusz Krzysztofik
@ 2009-06-23 14:22 ` Jiri Kosina
0 siblings, 0 replies; 4+ messages in thread
From: Jiri Kosina @ 2009-06-23 14:22 UTC (permalink / raw)
To: Janusz Krzysztofik; +Cc: Mark Butsch, 'linux-input@vger.kernel.org'
On Tue, 23 Jun 2009, Janusz Krzysztofik wrote:
> > You can either unbind HID driver from the device completely, and write your
> > own userspace driver using libusb.
> > Or you can patch the HID driver not to attach this device to inpu subsystem,
> > and only trigger creation of /dev/hidraw (or /dev/hiddev respectively), and
> > write user-space application that will process the HID events from these
> > device nodes, and process them in your application as needed.
> I thouhgt this could be done from userspace without any kernel modification,
> just the way "input-events -g" does it. Am I missing anything?
Calling ioctl(EVIOCGRAB) is of course another possibility, if you are
perfectly fine with the work HID driver does and don't need any
modifications there (i.e. no changes in usage parsing, etc).
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-06-23 14:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-10 19:40 How do you keep input from a USB Mag card reader from going to STDIN? Mark Butsch
2009-06-23 14:02 ` Jiri Kosina
2009-06-23 14:19 ` Janusz Krzysztofik
2009-06-23 14:22 ` Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox