koreader / kindlepdfviewer

(DEPRECATED, please use KOReader instead) A PDF (plus DJVU, ePub, TXT, CHM, FB2, HTML...) viewer made for e-ink framebuffer devices, using muPDF, djvulibre, crengine
GNU General Public License v3.0
498 stars 98 forks source link

Multi-touch gestures needed in new UI branch #769

Closed chrox closed 11 years ago

chrox commented 11 years ago

I intend to implement a multi-pages turning function in new_ui_code as a necessary supplement to the standard tap-to-paging way. It's especially useful for browsing and referring certain distant location.

The operation should be as simple as possible. When a "hold" gesture is detected on the right part of the screen, ReaderPaging should remember the current page as the original page. While the hold is not released, number of pages to turn is calculated by the swipe distance and direction. Once the users find the right position they are looking for, they can release the hold. And then a single swipe should restore the original page. The users can go on with their readings.

Current gesture detector just blocks the input events when a "hold" gesture is not released.

chrox commented 11 years ago

As I tested the "hold" gesture I found a way to replicate the "set up tap timer" crash. With a "hold" gesture not released, an additional "swipe" will make it crash immediately. Error message is as follows:

# set up tap timer
lua config error: ./frontend/ui/time.lua:81: attempt to index local 'self' (a nil value)
stack traceback:
    ./frontend/ui/time.lua:81: in function '__add'
    ./frontend/ui/gesturedetector.lua:213: in function 'feedEvent'
    ./frontend/ui/inputevent.lua:405: in function 'waitEvent'
    ./frontend/ui/ui.lua:204: in function 'run'
    ./reader.lua:180: in main chunk
houqp commented 11 years ago

This idea is great :) To implement multi-touch, we need to take into account of multiple input slots. Currently, gesturedetector only handles one input slot. I won't have time to play with multi-touch at least in following two weeks, so feel free to hack on it if you want ;p

BTW: I cannot reproduce the crash with my latest PR now. Hopefully, this bug is fixed.

houqp commented 11 years ago

since the feature is already added to new ui branch, can we close it now?

chrox commented 11 years ago

Yes. Things left should be detecting more gestures. :)