orentrutner / reading-ruler

GNU General Public License v3.0
14 stars 2 forks source link

Arrow down skips lines #2

Open b-d-m-p opened 3 years ago

b-d-m-p commented 3 years ago

Not sure if you intended for us to be able to use the arrows, but they work generally. Sometimes they skip lines though. Would like to have that feature.

orentrutner commented 3 years ago

An intriguing idea! I have to admit I didn't quite plan for that use case. Reading Ruler at its current incarnation always highlights the line under the mouse cursor. I can see how for some websites the arrow keys would scroll exactly one line at a time -- which would give that neat line-by-line keyboard experience. But that would be a happy accident of the browser just happening to scroll exactly one line at a time. In other sites or pages, the browser might scroll more or less, resulting in skips.

I imagine you're proposing a variation of the current behavior where instead of following the mouse, the highlights follows the arrow keys -- or perhaps tries its best to respect both. To stay true arrow-key navigation, it would let the highlight depart the mouse cursor to avoid line skips. Is that more-or-less the spirit of the idea?

There might be some edge cases to noodle through. For example, if the browser is scrolling slightly faster than one line at a time but the highlights always move just one line each down key, there would be a point where the highlight just disappears above the viewable portion of the scrollable document. I'm not quite sure how to deal with that yet.

I find the proposal appealing. I'll appreciate more thoughts to flesh out the desired behavior. Thanks!

b-d-m-p commented 3 years ago

Yeah, that's the ideas! I think it would be good.

Nudin commented 2 years ago

I'd love to see this. It's probably easier to implement it with other keys then Arrow up/down – for example j and k. This would avoid interference with the browsers own key shortcuts.