Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input: Only ignore hovering *pen* events on the Elipsa #8021

Merged
merged 14 commits into from Aug 3, 2021

Conversation

NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Jul 24, 2021

The kernel currently reports an ungodly amount of bogus 0-pressure finger down events, making the previously dumb logic highly annoying.

I can deal with missed pen taps (somewhat, it's still annoying). But missed finger taps are highly aggravating.


This change is Reviewable

There are currently too many broken 0-pressure *finger* events being
reported on the Elipsa, making a dumb rejection highly annoying.
@NiLuJe
Copy link
Member Author

NiLuJe commented Jul 24, 2021

First commit depends on koreader/koreader-base#1393

@NiLuJe
Copy link
Member Author

NiLuJe commented Jul 25, 2021

Also includes a rewrite of the snow protocol logic to hopefully be simpler, and rely on actual events instead of confusing heuristics.

Needs actual testing on earlier snow devices than Mk. 7 (as in, an actual snow: a H2O² ;)).

Comment on lines 437 to +443
function Input:handleKeyBoardEv(ev)
-- Detect loss of contact for the "snow" protocol...
if self.snow_protocol then
if ev.code == C.BTN_TOUCH and ev.value == 0 then
-- Kernel sends it after loss of contact for *all* slots,
-- only once the final contact point has been lifted.
if #self.MTSlots == 0 then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not interested to understand all that, but just reading this, I wonder: why do we handle touch/MT/multitouch slots in a handleKeyBoardEv() function ?!
If this is not an error, it may need a bit of comment saying why :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think because BTN_TOUCH is a "keyboard" event, contrary to the other touch events.

Copy link
Member Author

@NiLuJe NiLuJe Jul 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it's an EV_KEY event, while the other handler is for EV_ABS... and EV_SYN (which includes SYN_REPORT, which is where we actually finalize the slot data and send it to GestureManager ;). Hence the early return in this new branch.

Copy link
Member Author

@NiLuJe NiLuJe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 2 files at r2, 2 of 2 files at r3.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @poire-z)

@NiLuJe
Copy link
Member Author

NiLuJe commented Aug 3, 2021

Hasn't eaten my Forma during the week, so, let's see how it fares against a wider audience... ;).

Copy link
Member Author

@NiLuJe NiLuJe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dismissed @poire-z from a discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @NiLuJe)


frontend/device/input.lua, line 443 at r3 (raw file):

Previously, NiLuJe (NiLuJe) wrote…

Yep, it's an EV_KEY event, while the other handler is for EV_ABS... and EV_SYN (which includes SYN_REPORT, which is where we actually finalize the slot data and send it to GestureManager ;). Hence the early return in this new branch.

Done.

@NiLuJe NiLuJe merged commit bc133e7 into koreader:master Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants