tvhong / incremental-reading

Anki add-on providing incremental reading features
https://ankiweb.net/shared/info/935264945
ISC License
33 stars 7 forks source link

Move movement keys handling to js #4

Closed tvhong closed 2 years ago

tvhong commented 2 years ago

Notes

The incremental-reading movement key configs should only apply to IR card types. However, the previous implementation cannot distinguish between different card types and fails on non-IR card types (see issue below).

This PR moves the movement key handling to javascript so that if the card type is non-IR, we can fall back to the standard scrolling behavior. Moving to javascript is necessary as PyQt does not have default handlers for movement keys (https://forums.ankiweb.net/t/how-to-fallback-to-default-keystroke-handlers-for-shortcuts/23088).

Issue

https://github.com/tvhong/incremental-reading/issues/2