Add plugin to configure Tapback sensitivity on Kindle 12th Gen - #15968
Add plugin to configure Tapback sensitivity on Kindle 12th Gen#15968vitorroman17 wants to merge 10 commits into
Conversation
|
It's a good idea, but the functionality should go in the Kindle device abstraction. If this was co-developed by AI, tell it to look at the Kobo automatic sysfs discovery. Also you're ignoring io.open failure, and you should use |
|
PS It should say |
…d Kindle device abstraction
| text = _("Taps and gestures"), | ||
| } | ||
|
|
||
| if Device:hasFancyTaps() then |
There was a problem hiding this comment.
This seems subtly different than the tapback_sysfs_path detection. It does look at a glance like the entire sysfs detection can be skipped if this isn't true but at least the way you phrased it, it sounds like adjusting it can only be done on a subset of devices with hasFancyTaps?
| ffiUtil.writeToSysfs(tostring(x), path .. "/threshold_tap_x") | ||
| ffiUtil.writeToSysfs(tostring(y), path .. "/threshold_tap_y") | ||
| ffiUtil.writeToSysfs(tostring(z), path .. "/threshold_tap_z") |
There was a problem hiding this comment.
I think this doesn't really belong in here but should be defined in the Kindle device definition as something like Kindle:setTapbackSensitivity (for example). I figure you can also add hasTapBackSensitivity() while you're at it.
| for file in lfs.dir("/sys/bus/iio/devices") do | ||
| if file:match("^iio:device%d+$") then | ||
| local path = "/sys/bus/iio/devices/" .. file | ||
| local name = ffiUtil.readSysfs(path .. "/name") |
| "gesture_manager", | ||
| "gesture_overview", | ||
| "gesture_intervals", | ||
| "tapback_sensitivity", -- if Device:hasFancyTaps() |
|
|
||
| local dialog | ||
| dialog = MultiInputDialog:new{ | ||
| title = _("Tapback sensitivity\n\n1 = Most sensitive | 31 = Hardest | 0 = Disabled"), |
There was a problem hiding this comment.
is 0-31 really the scale?
in any case, I think something like 1 = Lightest tap | 31 = Hardest tap | 0 = Disabled is a little clearer
|
I'll take a look in the coming days :D never used it exactly because it is too sensitive. |
|
Thank you for the detailed feedback! I have restructured the implementation to align with KOReader's architecture:
Let me know if there's anything else! |
Have you seen line-comments above? Ah, sorry, I think yes. But somehow these comments didn't get auto resolved? |
Yes, answering why the scale is 0-31. Does kernel set those 32 steps? If yes, would it make sense to translate it to a more sensible 0-10 perhaps? |
They're only partially addressed. Possibly because of forgetting to commit a file? |
This PR adds a simple plugin (
tapback.koplugin) that allows users to configure the sensitivity (threshold) for the hardware tap gesture (accelerometer tapback) on the new Kindle 12th Gen devices.Currently, the default threshold in the sysfs node is extremely low (
1), which makes the device trigger page turns on very light taps or accidental bumps. This plugin provides a UI underMore Tools->Tapback sensitivityto adjust the X, Y, and Z axis thresholds independently and persists the settings across reboots.This change is