* refactor onStopHighlightIndicator so it returns early
* stop text selection when opening menus or triggering hotkeys
* use self.ui.highlight (naturally)
* remove duplicated setDirty
We may happen to have an empty selection while panning,
no reason to abort the selection yet before release.
Also add get_segments=true to remaining calls to
getScreenBoxesFromPositions() that we forgot to
update to use it.
* Removed the hold-duration logic for switching between dictionary and wiki lookups, simplifying the process and removing timing-based domain switching, this was a terrible idea on my part (in hindsight, the implementation I mean).
* Added a new `TextSelectorModifierPress` key event and corresponding handler (`onTextSelectorModifierPress`) to explicitly switch domains (Dict <-> Wiki) during text selection, and for following links inside dictionary entries, thus making the feature more discoverable and reliable.
* Refactored the lookup logic into a dedicated `_performLookupOnSelection` function, improving code clarity.
* Updated the gesture coordinate calculation in `_createTextSelectionGesture` to use `text_widget` absolute position instead of `definition_widget`, ensuring correct screen coordinates and accounting for container padding.
Previously, on SDL targets (Desktop, Ubuntu Touch), the system text input loop was gated by the visibility of the On-Screen Virtual Keyboard. Hiding the VK would call Device:stopTextInput, effectively disabling the physical keyboard.
This commit binds the text input state to the lifecycle of the InputText widget instead:
* Improve up/down behavior. Down at the end of an input moves focus down, up at the beginning moves focus up.
* Undo removal of key_event for touch devices, allowing vk to work regardless of vk state, #FreeTheKeyboard
https://github.com/koreader/koreader/pull/14895 is a bit inefficient and does not take the option to lock the orientation in place.
This change reuses the existing functionality and in turn respects the other settings as well
Wrap LIPC calls in pcall() to prevent crashes when accessing Wi-Fi properties.
This PR adds error handling to five critical functions that interact with the Kindle's LIPC (Lab126 IPC) system for Wi-Fi management. Without proper error handling, these functions can crash KOReader when LIPC calls fail.
Replace the cumbersome implementation of language rotation
with a more natural language selection:
- replace the "en > fr" button with a "Language" button,
which on tap shows a popup with the user languages allowing
direct selection (instead of having to rotate through
all the intermediate languages and wait for each result)
- we don't touch anymore the user-set wikipedia_languages
array when switching language
- the newly selected language is stored in doc_settings, and
will be used for next queries on this book. It is also
stored in G_reader_settings as the language to be used
for next newly opened books and for lookups done when
in FileBrowser
Also:
On Wikipedia full articles, the top left hamburger menu
shows a popup with the other Wikipedia languages the
current article is available for, and allows reading
them.
Wikipedia article ToC: the 'sections' properties
of the Wikipedia API is now deprecated: use its
replacement 'tocdata'.
Could cause some refreshes (actually triggered when
the scrollbar changes) in DictQuickLookup to be ignored
in some rare circonstances (2 consecutive results from
a text dictionary having the exact same nb of lines).
Avoid 429 error messages from Wikipedia by caching the returned cookie
from the initial response header. Using a cookie for image requests
treats each koreader image request as its own user with separate throttling
rates.
At reader startup, so the intended use case is correctly handled:
- an update is downloaded, and the user restarts KOReader
- the LuaJIT process returns control to the startup script which extracts the update
- the LuaJIT process is restarted, and if the startup script was changed, the user
is asked to quit and restart KOReader from the parent launcher
- prior to #14719, `$KOREADER_DIR` was not part of the environment,
so an update relying on it without a restart from the parent
launcher would crash KOReader on startup
- pocketbook: fix check (`koreader.app` is located in `$KOREADER_DIR/..`)
- remarkable: ensure `$KOREADER_DIR` remain correct after relocalization
The input device is autodetected by FBInk, which should hopefully mean we don't have to think about this again when it hits new devices ;).
(Supported devices were the PW6 & CS at time of writing)
Re #14461