View Single Post
Old 23 December 2011, 02:28   #6
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Quote:
Originally Posted by jman View Post
So, what I really need is a callback that handles the events and let me choose those interesting from those uninteresting.
With such a handler I can read all events passing through the device, correct?
Yes all input events will pass through your handler.

Quote:
Originally Posted by jman
Also, I think I see why I need such a listener: it wouldn't be possible to simply perfom a SendIO() with a CMD_READ set at IO_COMMAND offset of my IoStdReq. I would probably end up getting ... random data, I'd say, right? Not the input event I want, maybe I could intercept a mouse movement or whatever is passing through the input.device in that moment. right?

Maybe the CMD_READ is more targeted to reading from a serial interface?

Thanks for clarifying these points :-)
CMD_READ is one of several commands that need to be supported by all devices, and a must for storage devices like trackdisk.device etc., but I don't think it has any effect when sent to input.device. It's not mentioned in the reference material for input.device at least.

There are other methods of getting input events and data from the keyboard that might be better depending on what kind of program you're writing, but this method works for everything and should handle external HIDs such as USB keyboards without any extra code.
Leffmann is offline  
 
Page generated in 0.17272 seconds with 11 queries