View Single Post
Old 04-20-2017, 09:00 PM   #184
coplate
Guru
coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.
 
Posts: 645
Karma: 1888888
Join Date: Jun 2009
Device: prs-505, Kindle Keyboard 3g, PW3
Hot swappable kernal module

OK, here is the simplest version I have made, I'm not entirely happy with it, but it's time to put it out into the world.



Usage should be in the form:

Code:
insmod hid.ko  2>&1
sleep 1
insmod usbhid.ko 2>&1
sleep 1
insmod mousedev.ko 2>&1 # ( I have no idea why, but like you saw, if I don't use this we often get the device disconnecting and reconnecting repeatedly
sleep 1
insmod mdcbug.ko 2>&1
sleep 1

killall kindlelazy > /dev/null 2>&1
sleep 3
./kindlelazy  &
It will make a device named /dev/mdcdev.

You will need to change kindlelazy to use this device.
Maybe you could make the device part of the configuration. I do plan on changing this module considerably in the future though, this name is not well though out, just my initials. I'm thinking of something like 'evhot' to mimic 'evdev'.



Can you give this a test, changing your source code to open device /dev/mdcdev instead of inputs 2 and 3.


Current limitations:

The device can only be opened by one application.
( So you cannot read it in kindlelazy, and tail it from the command line ).

It has a very basic device filter - anythign with eh left mouse button, or the "enter" key.

Device does not support most ioctl calls, so it cannot be used by evtest or Xorg, it can only be read.

Long term plans:

My long term plan for this module would be for it:

To work on any linux device.

Be opened by any number of applications.

Provide multiple /dev/somethng_mouse, something_kbd, something_all devices. So that like Xorg can open jsut the keyboard part.

For this, I will need to implement all of the ioctl calls, and provide a list of events that I can actually support.


Edit:
When I put the device to sleep running a copy of kindlelazy that just showed all the events, the device crashed on wakeup. Do not use this yet.

Edit2:

I have uploaded a new version that does not open the touchscreen of the power button.

It will only register for certain mice ( must have a left button ) and certain keyboards ( must have an ENTER key ) now.


Tested again, and no crash on reboot. I had it just write all the events to a file, the following 4 test cases worked. ( of cource including the test case of leaving it unplugged )


Plug in, suspend, wakeup,
Plug in, unplug, suspend, wakeup, plug in.
Plug in, suspend, unplug, wakeup, plug in.
Plug in, suspend, unplug, plug in, wakeup.


zxczxc, if you get the change, can you give me the output of
evtest /dev/input2
and
evtest /dev/input3 on your presenter.

If it registers as a mouse and keyboard, but it doesn't have an enter key, I wonder which keys it lists.
Attached Files
File Type: zip mdcbug.zip (9.0 KB, 252 views)

Last edited by coplate; 04-20-2017 at 11:41 PM.
coplate is offline   Reply With Quote