koreader / koreader

An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices
http://koreader.rocks/
GNU Affero General Public License v3.0
16.84k stars 1.26k forks source link

FR: Tolino Epos 2 (Kobo Forma) auto-rotation based on gyroscope #10391

Closed mikebluu closed 1 year ago

mikebluu commented 1 year ago

Does your feature request involve difficulty completing a task? Please describe. The built-in Tolino reader uses the gyroscope to rotate the screen (although not instantly, but with a confirmation pop-up), switching the page turn buttons too. KOReader on the other hand does not have an auto-rotate setting, and even when I manually rotate the screen, the buttons are just as before, nothing changed.

Describe the solution you'd like A switch somewhere in the rotation settings would allow me to use the gyroscope (with or without confirmation) to rotate the screen and switch the page turn buttons accordingly.

Describe alternatives you've considered Maybe a gesture that would rotate the screen and switch the page turn buttons at the same time, but the gyro would then be useless.

Additional context My device is rooted, and I have access to ADB Shell, so I should be able to do (device-wise) everything that I'm asked to.

From ADB Shell, this is the output of getevent, in the following orientations: Buttons on the bottom side:

/dev/input/event2: 0003 0000 ffffc84d
/dev/input/event2: 0003 0001 00001e85
/dev/input/event2: 0003 0002 ffffeffb
/dev/input/event2: 0000 0000 00000000
/dev/input/event2: 0003 0000 ffffc181
/dev/input/event2: 0003 0001 00000292
/dev/input/event2: 0003 0002 fffff675
/dev/input/event2: 0000 0000 00000000

Buttons on the right side (default rotation, theoretically):

/dev/input/event2: 0003 0000 ffffe310
/dev/input/event2: 0003 0001 000032ff
/dev/input/event2: 0003 0002 fffff97f
/dev/input/event2: 0000 0000 00000000
/dev/input/event2: 0003 0000 fffffd94
/dev/input/event2: 0003 0001 00004175
/dev/input/event2: 0003 0002 fffff8f3
/dev/input/event2: 0000 0000 00000000

Buttons on the top side:

/dev/input/event2: 0003 0000 000038de
/dev/input/event2: 0003 0001 00001782
/dev/input/event2: 0003 0002 fffffae6
/dev/input/event2: 0000 0000 00000000
/dev/input/event2: 0003 0000 00003eff
/dev/input/event2: 0003 0001 00000366
/dev/input/event2: 0003 0002 fffff585
/dev/input/event2: 0000 0000 00000000

Buttons on the left side:

/dev/input/event2: 0003 0000 00001908
/dev/input/event2: 0003 0001 ffffc832
/dev/input/event2: 0003 0002 fffff5cf
/dev/input/event2: 0000 0000 00000000
/dev/input/event2: 0003 0000 000003b9
/dev/input/event2: 0003 0001 ffffc289
/dev/input/event2: 0003 0002 fffffd53
/dev/input/event2: 0000 0000 00000000
pazos commented 1 year ago

Duplicate of #9483

mikebluu commented 1 year ago

Thanks for letting me know that there was already someone with a similar problem. To make sure that I understood the issue you linked, there is nothing that could be done because every vendor has a different way of implementing the accelerometer?

pazos commented 1 year ago

Hi, @mikebluu

gyro events are the same for all android devices. We just need a contributor that cares enough to implement a common logic that bridges android with the rest of the platforms, because now they're incompatible as far as gyro events.

Please use the linked ticket instead of this one :)