Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize /dev/input/event# handling #6

Open
sunshinetech007 opened this issue Feb 23, 2019 · 6 comments
Open

Customize /dev/input/event# handling #6

sunshinetech007 opened this issue Feb 23, 2019 · 6 comments

Comments

@sunshinetech007
Copy link

Hi, Thank you for your work here! My kindle puts the up/down kbd on event4 and not event2, and puts the volume/up (brightness) on event3. So while brightness works, the page forward and back does not.

Would it be possible to allow us to set or override the default character devices a specific kindle must use in the config.json? (I'm assuming that would be the easiest way)

event_brightness = "event3"
event_page_turn = "event4"

Or something like that.

Otherwise grepping through /proc/bus/input/devices would work and finding which character device the kbd entries get assigned, but I assume that's way more work to code.

@llakssz
Copy link
Owner

llakssz commented Feb 24, 2019

Sure it's possible, maybe just something simple like specifying the numbers of event devices you want to use, in an array in the json file.
Like: events = [3,4]

But I don't have any kindle development stuff installed so I won't be able to build it right now.
I will see what I can do.

What device are you using? (First 4 or 5 characters of the serial number is best!)

@sunshinetech007
Copy link
Author

Yeah that method of just a number would work great, as well.

I'm using I think the same Kindle you programmed it for I believe, Serial G090 G105 with firmware 5.9.7 with kernel "Linux kindle 3.0.35-lab126 #2 PREEMPT Tue Jul 24 06:43:56 PDT 2018 armv7l GNU/Linux"

The modules list 3.035-lab126 as the kernel it's linked to. I does work, I get all the events properly using "evtest /dev/input/event[3.4]"

I'm unsure why mine doesn't use events2/3. Maybe the presenter you use has changed. (I ordered the one you specififed)

It is possible to grep for the right events without user input, although probably lots more coding. These lines will give you the proper events on a kindle no matter where they are, at least with the 2019 version of the presenter.

grep -B2 'EV=120013' /proc/bus/input/devices | grep -o 'event[0-9]'

grep -B2 'EV=1f' /proc/bus/input/devices | grep -o 'event[0-9]'

The code to use those is here, but his grep lines don't work quite right on a kindle.

https://github.com/kernc/logkeys/blob/033e51201ae41528823837c369a00d29cf478da6/src/logkeys.cc#L334

I've been trying to setup a compile environment following the directions in the 5.9.7 Amazon provided source files but so far I'm completely stymied for various reasons - mostly a lot of stuff from 2012 doesn't work anymore. Packages are gone, links are broken, repositories now require TLS and ubuntu 12.04 python packages don't have it, etc.

I tried lots of other solutions, such as removing /dev/input/event2 and using mknod to recreate it and point it to the right major/minor device. And that works. I get keyboard output with evtest /dev/input/event2 in addition to event4, but KindleLazy doesn't recognize the fact that the device file changed and never gets the new input. Anyway, thanks for the response and help, sure appreciate it!

@llakssz
Copy link
Owner

llakssz commented Feb 25, 2019

Until you or I get a working dev setup, here's something ugly for you for the mean time:
I hex edited the kindlelazy binary from 'event2' to 'event4'. Let me know if it works!

Simply replace the kindlelazy binary file with it.
https://anonfile.com/kb30e1vbb4/kindlelazy_zip

If you are unsure of the file, compare it with the original in a hex editor, there should only be two changes.

@sunshinetech007
Copy link
Author

You know funny enough I just did that yesterday and it worked. I have it working no issues. I had to replace all instances of event2 with event4 using find replace all to get it to work. Thanks! I posted the file to the KindleLazy thread on mobileread.

@llakssz
Copy link
Owner

llakssz commented Feb 26, 2019

Great minds think alike. Anyway, in time I'll try to improve this.

@bingo619
Copy link

Please improve this, I had to use event 4,5,6 for my KOA 1, 3G model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants