View Single Post
Old 09-24-2016, 06:09 AM   #1
zxczxc
Addict
zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.
 
Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
KindleLazy - remote control page turns + brightness

Hi, here is KindleLazy 0.5

Video:
https://www.youtube.com/watch?v=Ti_KD58UWuc

You can turn pages and alter brightness via a device like a keyboard.
I use a wireless 'presenter', it sends keys like page up, page down etc.
I specifically use this product: https://www.amazon.com/dp/B00SYK18T0

KindleLazy is configurable, you can set what keys do what action.

Thanks to lucida and knc1 for the help.
lucida for the usbotgmouse extension which I based my extension on, advice on using Amazon's toolchain etc...
knc1 for all the general help to me and all over the years!
plus every other helpful member, thank you.

KindleLazy 0.5 readme:
Spoiler:

KindleLazy 0.5 - cearp

Only tested on PW3, nothing else!

At the moment this only reads from event2 and event3 - this is what my device reads as.
This should be improved later.

There is no hotplugging, have the device inserted before starting. If the device is removed, this app may quit.

The page turn direction can be reversed, so that your 'forward' button can still advance you to the next page.
For example, with books that are 'right to left', where the next page is on the left, you would reverse the direction.

The program will not work without a config file named 'config.json' in the same directory.
NOT menu.json and NOT config.xml, these are files for KUAL.

Here is a sample (and the default) config file:

{
"key_brightness_down" : [ 115 ],
"key_brightness_up" : [ 114 ],
"key_next_page" : [ 104, 103, 106 ],
"key_prev_page" : [ 109, 108, 105 ],
"reverse_direction" : false
}

Errors in the config file are not handled, it will probably crash.
Beware of commas and other punctuation.

Enter the keycodes for the keys you want to trigger the actions.

For the config above, the key codes represent:

104 = KEY_PAGEUP
109 = KEY_PAGEDOWN

103 = KEY_UP
108 = KEY_DOWN

105 = KEY_LEFT
106 = KEY_RIGHT

114 = VOLUME_DOWN
115 = VOLUME_UP


I can see some keycodes here, I am not sure if some devices produce different ones.
https://android.googlesource.com/pla...rds/Generic.kl


I want to improve this and add hotplugging (inserting/removing the usb device(s) any time when the program is running)

I also want to print a message to the screen (like usbnet does) that shows when the program starts, the current page direction, show a message when the program quits, etc...

I assume this will work on KV, OA... I'm not sure about PW2.
As for future proofing, the screen size is not hard coded so it should work with any resolution.

Any advice on how to do these things, or just advice on my programming is welcome!
Pull requests on github are welcome

Github page - https://github.com/llakssz/KindleLazy/
Download from - https://github.com/llakssz/KindleLazy/releases

Last edited by zxczxc; 09-24-2016 at 08:54 AM.
zxczxc is offline   Reply With Quote