Commit Graph
190 Commits
Author SHA1 Message Date
k4rnaj1k 9f7a0e420d [Kindle Scribe] Add support for kindle scribe stylus events (#14908) 2026-03-08 12:37:23 +01:00
Benoit Pierre 75d47c9aa7 kindle: fix restart on special offers devices (#14837)
Fix leftover use of `ffi/input` (removed in #12486). Close #14833.
2026-01-18 10:23:24 +01:00
cb12tre 9702aaaed9 Add error handling to Kindle Wi-Fi functions (#14817)
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.
2026-01-15 19:36:08 +01:00
Benoit Pierre 8d7b0792fb kindle / pocketbook / remarkable: fix startup script change detection
- 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
2026-01-06 21:26:30 +01:00
NiLuJe 3712e14a82 Kindle: Autodetect & handle the fancy gesture_tap input device (#14506)
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
2025-12-26 03:33:20 +01:00
Benoit Pierre c93624d2c5 kindle: detect if launcher script has changed
And a complete restart from the parent launcher (e.g. KUAL) is needed.
2025-12-13 10:59:04 +01:00
scamdotnet 577727c6b6 Kindle: add missing colorsoft serial snippits (#14393)
See https://kindlemodding.org/models.json
2025-10-01 08:57:53 +02:00
David 1ad234d754 [Device, kindle] early return if kindleGetCurrentProfile() is nil (#14219)
fixes #14215
2025-08-28 23:01:58 +02:00
Peter Snajczuk 9ad9d52cef Support Kindle Oasis (KOA) charging cover "soda" (#13133)
Much of this code was taken from the Kobo implementation of an auxiliary battery. The biggest difference between the Kobo and Kindle implementation is that the status file for the charging cover is not present when the cover is detached, so the check for status there will result in the file failing to read.
2025-07-14 08:44:45 +02:00
Benoit Pierre f63c76d6d4 Use new Archiver module where applicable (#13782)
- ArchiveViewer: instead of using unzip and to support more formats
  (only CBR & RAR for now)
- NewsDownloader & Wikipedia plugins: instead of using `ZipWriter`
- device: re-implement `Device:unpackArchive` and get rid of device
  specific `untar` implementations
- readerui: instead of using unzip for document provider detection
2025-05-26 16:52:38 +02:00
mergen3107 4816757534 Kindle: add hall file for PW6 (#13615) 2025-04-18 19:15:58 +02:00
Jackson Hacker 968703494e Add Kindle Basic 5 hall file (#13603) 2025-04-16 16:10:01 +02:00
David 135453776a Add key_repeat support to Kindle NT (#13328)
closes #12745
2025-03-15 23:31:30 +01:00
Marek Veselý f3f518afd5 [device] add Kindle Scribe 2 support (#13051) 2025-01-12 09:03:03 +01:00
Marek Veselý 038df71ca5 [device] Add the new Kindle line-up (#12990)
* add Kindle ColorSoft
* add Kindle PW6 and KT6
2025-01-03 17:29:47 +01:00
hius07 6e84503b3d Add support for KindlePaperwhite5 Signature Edition light sensor (#12946) 2024-12-28 19:42:44 +01:00
mergen3107 f8446538c0 Fix KOReader spelling in the code (#12670) 2024-10-24 10:46:46 +02:00
mergen3107 ee17b44b58 Kindle Scribe: fix elseif for orientation code (#12663)
Fixes #12662
2024-10-20 18:58:34 +02:00
Benoit Pierre d98fe14ba8 input: fix loading of fbink_input library (#12560)
The library is versioned.
2024-09-26 23:07:15 +02:00
Benoit Pierre a1edbbf0c4 use new ffi.loadlib helper (#12545)
To load our native libraries.
2024-09-26 18:36:09 +02:00
Benoit Pierre 0c0d2ab9f1 input: drop use of ffi/input
Get rid of the weird interaction between device implementations,
`ffi.util` (`isSDL`, `noSDL`) and the device input code: each
device knows if it's using SDL or not, so rely on that to load
the right underlying input implementation.
2024-09-24 16:08:58 +02:00
NiLuJe 3401bed3d1 Kindle: Restore hall effect sensor state on startup (#12521)
Fix #11744
2024-09-18 15:06:23 +02:00
NiLuJe da74691515 Chore: Don't cache static data tables (ui/elements, ui/data, kb layouts & co) (#12519)
Using `require` didn't make much sense since most of them are only used in a single place anyway, and it takes care of a few weird interactions in the process (besides not polluting `package.loaded` with useless crap ;)).
2024-09-16 17:11:42 +02:00
NiLuJe ca71bb2917 Input: Ignore ABS_X, ABS_Y & ABS_PRESSURE for snow_protocol (#12427)
On Monza, the lift frame can report these for *multiple contacts* without an id or a slot, which is super-duper invalid -_-".

(And we have ABS_MT_POSITION_X & ABS_MT_POSITION_Y for the "saner" frames, plus these devices generally don't support pens, so we don't make use of pressure).

(Also, switched to a dedicated handler like for the phoenix quirks, to avoid bogging down the standard handler with hacks for broken drivers).

Fix #11910
2024-08-30 16:04:28 +02:00
David 4910afffdd Add numerical key_codes to event_map on kindle 3 (#12358) 2024-08-24 14:17:40 +02:00
Martín Fernández 617618d587 Add Device:otaModel() (#12014)
Devices with a single target might want to specify it in `Device.ota_model`
Devices with multiple targets want to override the function or to specify `ota_model` variants for each target.
2024-06-25 21:35:38 +02:00
Marek Veselý 4c4cfa2db0 Kindle: add wifi selector (#12056)
* Kindle: Implement a NetworkMgr backend loosely based on WpaClient in order to allow feature-parity with hasWifiManager platforms. This involves dealing with the native wifid over lipc (the native IPC system, based on DBus), through custom Lua bindings (https://github.com/notmarek/openlipclua), since the stock ones lack support for the needed hasharray data type.
* NetworkMgr: Clear up leftover hallucinations from #10669, making `enableWifi` much simpler (and much more similar to `turnOnWifiAndWaitForConnection`).
* NetworkMgr: Made it clearer that `turnOnWifi` implementations *must* deal with `complete_callback`, as part of the aforementioned changes mean that it's *always* wrapped in a connectivity check, and we need that for proper event signaling.
* Android, Emu: Run `complete_callback` properly in `turnOnWifi`.
* Kindle: Support `powerd:isCharged()` on the PW2 (yes, this is random, it just happened to be my test device :D).
* NetworkMgr:disableWifi: Properly tear down any potential ongoing connection attempt (e.g., connectivity check).
* NetworkMgr:promptWifi: Make the "wifi enabled but not connected" popup clearer if there's an ongoing connection attempt, and gray out the "Connect" button in this case (as it would only lead to another "connection already in progress" popup anyway).
* NetworkMgr:reconnectOrShowNetworkMenu: Make *total* scanning failures fatal (they will lead to an immediate wifi teardown).
* NetworkMgr:reconnectOrShowNetworkMenu: Clear up the long-press behavior (which *always* shows the network list popup) so that it doesn't weirdly break all the things (technical term!).
* NetworkMgr:reconnectOrShowNetworkMenu: When we manage to connect to a preferred network on our own *before* showing the network list, make sure it is flagged as "connected" in said list.
* NetworkMgr:reconnectOrShowNetworkMenu: Make connection failures fatal in non-interactive workflows (they'll lead to a wifi teardown).
* NetworkSetting (the aforementioned network list widget): Clear NetworkMgr's "connection pending" flag on dismiss when nothing else will (i.e., when there's no connectivity check ticking).
2024-06-25 21:17:36 +02:00
Frans de Jonge 8f2bd5420d Introduce Device:useDPadAsActionKeys() (#11900)
1. Non-Kindle-specific `hasFiveWay` behavior is changed to `hasDPad and useDPadAsActionKeys`. For now they remain Kindle-specific in practice, unless one sets `useDPadAsActionKeys = yes` in a user patch.
2. With that disambiguation out of the way, `hasFiveWay` itself is further disambiguated into `hasScreenKB` and `hasSymKey`, as per the actual property being used, rather than something that tends to correlate with it. (It needn't be Kindle-specific per se, but non-Kindle devices have equivalent shortcuts with for example `Shift`.)
  Running the emulator with `DISABLE_TOUCH=1` will set `hasSymKey = yes`, which can be tested with right shift.

Closes #11887.
2024-05-26 21:25:54 +02:00
SomeGuy 577c5d454f Non-touch DPad improvements (#11749)
Closes #11295.
2024-05-20 21:20:50 +02:00
NiLuJe 4d9c6523ad Input: Some more followups to the input device auto-detection stuff (#11855)
Switch to a new `input.fdopen` API & wrapper so we can keep the fds opened by `fbink_input_scan` instead of closing them to re-open them right after that...

This should hopefully help on racy zForce devices that attempt to handle power management when opening/closing the device. We know this sometimes horribly fail to re-activate the IR grid (c.f., our manual activation on resume), but this apparently could also happen here (re: #11844) because of the quick succession of open->close->open.
2024-05-19 22:53:14 +02:00
NiLuJe 05168b22f5 Kindle: Don't forget about fiveways on legacy devices & fix a couple input-scan misdetections (#11827)
* Kindle: Don't forget to open INPU_DPAD devices for the fiveways. Somehow managed to skip my mind, they're often on a separate input device.

Regression since #11807

* Update FBInk to fix a few cases of input_scan misdetection (on misconfigured drivers (e.g., no DIRECT prop on supported kernels), or old kernels with no EVIOCGPROP support).

Fix #11824
2024-05-15 23:58:01 +02:00
NiLuJe fd5260f2ce Support auto-detection of input devices via fbink_input (#11807)
* Kobo: Drop a bunch of if ladder crap and switch to auto-detection of input devices via fbink_input
* Kindle: Drop an even larger bundle of crap to do the same ;p. (re: #11392)
* ExternalKeyboard: Switch to fbink_input to whitelist keyboards instead of the manual parsing of caps via its FindKeyboard class
* Input: Extended open/close wrappers to handle logging & tracking of dupe open/close calls.
2024-05-15 05:42:48 +02:00
mergen3107 8a316f928a Kindle: remove separate L and R orientations (#11780)
Fixes #11743
2024-05-14 10:31:14 +02:00
Predrag Đokić eb6e5e3c20 Kindle: Fix missing Amazon UI screensaver after exiting KOreader (#11794) 2024-05-10 22:18:41 +02:00
mergen3107 caea0e8fb2 Kindle Scribe: improve gyro detection, replace accel with acc keyword (#11696)
Fixes #11691.
2024-04-20 22:30:04 +02:00
mergen3107 d3011571a3 Kindle Scribe: find accelerometer based on hardware (#11642)
Closes #11392 (temporarily).
2024-04-18 09:33:11 +02:00
Hzj_jie d4c78aaa4f Kindle oasis has no ambient brightness sensor (#11456)
I did not notice an ambient brightness sensor, nor adaptive brightness feature. (Ref: https://www.geekwire.com/2016/kindle-oasis-review-amazons-premium-e-reader-use-premium-features/)

Was it previously wrongly configured?
2024-02-17 14:09:48 -08:00
NiLuJe c529c1cce3 Kindle: Log the args from WakeupFromSuspend & ReadyToSuspend 2024-01-15 04:29:09 +01:00
NiLuJe 588bf38c84 Kindle: Log the suspend/wakeup source
We currently don't do anything with it, but this might help someone come
up with fancier smartcover handling, like we do on Kobo...

Simplify the fake events w/args checks:
We can just hitcheck the table directly, no need for another hash

Also catch ExitedSS on Kindle.
And, again, dn't do anything with it ;p.
2024-01-15 04:29:09 +01:00
NiLuJe c97d20cd24 Chore: Make sure we always pass a rect to fb:refreshFull (#11307)
* UIManager: Init a full Geom on region-less refreshes in _refresh
* Never call refreshFull with no arguments
  I got rid of the low-level nil guards, because UIManager itself guarantees that it can never happen
* Bump base (https://github.com/koreader/koreader-base/pull/1718) (fix #11303)
* Kindle: Re-enable HW dithering on the Scribe
  Now that the underlying issue is fixed in base ;).
2024-01-12 21:23:23 +01:00
mergen3107 4a9473ed45 Kindle Oasis 1,2,3, Scribe: fix startup orientation (#11277)
Closes #11269
2024-01-11 13:22:17 +01:00
NiLuJe 4a15dce3e4 Kindle: Disable HW dithering on Scribe
Pending the actual fix from
https://github.com/koreader/koreader-base/pull/1718 that'll hit after
the release.
2024-01-09 17:24:16 +01:00
mergen3107 6c85547ce6 Add HW dither on Kindle Scribe (#11292) 2023-12-28 11:24:15 +01:00
mergen3107 4c2fc1eb81 Kindle Scribe: fix touch input (#11285) 2023-12-27 23:06:18 +01:00
NiLuJe 33b54f5574 Kindle: Add a hasLightSensor devcap, and use it in the AutoFrontlight plugin (#11255)
Add the Scribe to the list while we're there
2023-12-24 17:15:30 +01:00
NiLuJe 4a64e02c68 ScreenSaverLock: Hide the popup on suspend (#11174)
Fix #11164 and involves a drive-by fix:

Kindle: Send Suspend/Resume event regardless of the screen saver state

If we get the events, it means stuff happened, we can't just only honor
it in the most common workflows ;).

This effectively reverts a tiny bit of #10426 (I was sort of expecting
this to be problematic at the time, and I most likely hadn't tested it).
2023-11-29 00:15:50 +01:00
mergen3107 33c7f05158 Kindle scribe gyro and pen support (#11159)
* Kindle Scribe: add G-sensor and pen support, fix startup orientation

* Fixes #11144 and #11156
2023-11-28 07:07:18 -05:00
NiLuJe fee2b79829 Kindle: The KT5 requires the same input delving shenanigans as the PW5 (#11064) 2023-11-02 23:40:43 +01:00
NiLuJe d805a69446 Open input device outside of the readdir loop to workaround a bug in the
input backend
2023-10-30 08:41:23 +01:00
NiLuJe 84e942a326 Kindle: Auto-detect the input device on the PW5
Apparently, the by-path symlink went poof
2023-10-30 08:41:23 +01:00