Quote:
Originally Posted by rkomar
Taking a quick look through the koreader source code, I see that the pb_event_handler() function in "base/input.c" handles a few EVT_* events. You could add some code to handle the EVT_ORIENTATION events there, getting the new orientation from the "par1" variable. These are not strictly input events, so logically they don't fit with the rest of the code in that file, but you can only have one event handler function registered with InkView, so the orientation events have to be handled there along with the other events.
|
Hello @rkomar, thank you again for your research. Input events for PocketBooks are now handled in the `ffi/input_pocketbook.lua`. AFAIK the code you're linking is a part that is not used for Pocketbook's in their normal state anymore (might still be used if rooted?) but someone more knowledgeable may correct me of course:
https://github.com/koreader/koreader...pocketbook.lua
I've been trying to catch the EVT_ORIENTATION events there but no joy sadly. I also tried the `IsGSensorEnabled` and `GetGSensorOrientation` methods and there seem to work nicely. Sadly I will have to poll these every few seconds to make it workable.
I would prefer to use the EVT_ORIENTATION but I need some confirmation on where you saw them published on a unrooted device. It might be that you're using a rooted device and thus have more access to the event's that are published.
In any case. If there is no unrooted access to the gsensor events I will research on how to implement the gsensor with polling in koreader without draining the battery (this is the biggest hurdle).