-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Q: What is this symbol? #11514
Comments
Thank @Frenzie! Yes, I thought that it looks like a Pokemon ball, wasn't sure I can call it that :D |
Also see #2577 The pokeball never left the resources, but it hadn't been shown for a while. |
OK, it seems like it (or rather the long-tap itself?) not really working like it is intended in that particular case. Let me trace my steps back:
I will try to investigate this more. Here is the verbose log of these actions. I took screenshot around 09:37, log is truncated so it starts around 09:32 - so it should be OK. The log gets truncated (I think) because there are A LOT of input messages in verbose when I used a pen. |
Ah, I think I am getting closer. This is where I saw it again: instead of the two-finger gesture, it fell back to highlight a single word and Pokeball showed up, but no popup menu (I'll attach the photo in the next comment from phone). |
Then I tapped on the page, and only the highlighted disappeared. The Pokeball stays. |
(Can't reproduce - and not intestested in reproducing and investigating and screwing my settings :) it may depend on 1) having page turn swipe enabled 2) some combination of highlight actions 3) what's associated with double finger swipes (bookmarks, toc for me) 4) PDF vs EPUB 5) finger dexterity 6) finger fatness 7) finger greasiness...) |
The pen was still involved in that last log, right? That's the culprit, you need a clean pen lift with no other contacts, otherwise it might screw with MT gestures. |
If not, that's a bug, because the pen slot (which we enforce as 2) is kept as the current slot for the next single contact (given the lack of an explicit Unfortunately, I don't have a device with a separate pen input (that quirk is specific to how we handle wacom pens), on Kobo, everything ends up in the same input device, so this effectively behaves differently. |
In which case, something like this might help: diff --git a/frontend/device/input.lua b/frontend/device/input.lua
index bb41156f6..aa6b026d2 100644
--- a/frontend/device/input.lua
+++ b/frontend/device/input.lua
@@ -563,9 +563,10 @@ function Input:handleKeyBoardEv(ev)
end
elseif self.wacom_protocol then
if ev.code == C.BTN_TOOL_PEN then
- -- Always send pen data to slot 2
- self:setupSlotData(2)
if ev.value == 1 then
+ -- Always send pen data to a slot far enough away from our main finger slot that it can never be matched with a finger buddy in GestureDetector (i.e., +/- 1),
+ -- with an extra bit of leeway, since we don't even actually support three finger gestures ;).
+ self:setupSlotData(self.main_finger_slot + 4)
self:setCurrentMtSlot("tool", TOOL_TYPE_PEN)
else
self:setCurrentMtSlot("tool", TOOL_TYPE_FINGER)
@@ -578,11 +579,12 @@ function Input:handleKeyBoardEv(ev)
-- Much like on snow, use this to detect contact down & lift,
-- as ABS_PRESSURE may be entirely omitted from hover events,
-- and ABS_DISTANCE is not very clear cut...
- self:setupSlotData(2)
if ev.value == 1 then
- self:setCurrentMtSlot("id", 2)
+ self:setCurrentMtSlot("id", self.main_finger_slot + 4)
else
self:setCurrentMtSlot("id", -1)
+ -- Switch back to our main finger slot
+ self:setupSlotData(self.main_finger_slot)
end
end
|
No, the pen was only in the steps where I mentioned it. Last one was by hand |
Okay, then, yeah, the patch above might help, as otherwise the pen slot can end up being used for the following contacts up until the point where multiple contacts are tripped, and that can probably lead to screwy things ;). (And, like I mentioned, I can't test it myself, as this isn't a codepath exercised on Kobo devices). |
CRASH3_pen.txt |
Progress! (sortof ;p). Try this one (the logs are helpful, keep 'em coming ;))? diff --git a/frontend/device/input.lua b/frontend/device/input.lua
index bb41156f6..159ce02cb 100644
--- a/frontend/device/input.lua
+++ b/frontend/device/input.lua
@@ -178,6 +178,7 @@ local Input = {
-- touch state:
main_finger_slot = 0,
+ pen_slot = 4,
cur_slot = 0,
MTSlots = nil, -- table, object may be replaced at runtime
active_slots = nil, -- ditto
@@ -219,6 +220,10 @@ function Input:init()
},
}
+ -- Always send pen data to a slot far enough away from our main finger slot that it can never be matched with a finger buddy in GestureDetector (i.e., +/- 1),
+ -- with an extra bit of leeway, since we don't even actually support three finger gestures ;).
+ self.pen_slot = self.main_finger_slot + 4
+
self.gesture_detector = GestureDetector:new{
screen = self.device.screen,
input = self,
@@ -563,12 +568,14 @@ function Input:handleKeyBoardEv(ev)
end
elseif self.wacom_protocol then
if ev.code == C.BTN_TOOL_PEN then
- -- Always send pen data to slot 2
- self:setupSlotData(2)
if ev.value == 1 then
+ -- Switch to the dedicated pen slot
+ self:setupSlotData(self.pen_slot)
self:setCurrentMtSlot("tool", TOOL_TYPE_PEN)
else
self:setCurrentMtSlot("tool", TOOL_TYPE_FINGER)
+ -- Switch back to our main finger slot
+ self.cur_slot = self.main_finger_slot
end
return
@@ -578,9 +585,8 @@ function Input:handleKeyBoardEv(ev)
-- Much like on snow, use this to detect contact down & lift,
-- as ABS_PRESSURE may be entirely omitted from hover events,
-- and ABS_DISTANCE is not very clear cut...
- self:setupSlotData(2)
if ev.value == 1 then
- self:setCurrentMtSlot("id", 2)
+ self:setCurrentMtSlot("id", self.pen_slot)
else
self:setCurrentMtSlot("id", -1)
end |
Yep, a month ago I realized that I am much more useful if I just keep verbose logs on and stop worrying about writing full |
I tried the patch, still no bueno with pen: |
Hmm, that's better, but it looks likes a few lifts are missing, so, same idea, but with way more verbose logging :D. diff --git a/frontend/device/gesturedetector.lua b/frontend/device/gesturedetector.lua
index e71646fd9..7a59c600b 100644
--- a/frontend/device/gesturedetector.lua
+++ b/frontend/device/gesturedetector.lua
@@ -162,7 +162,7 @@ function GestureDetector:newContact(slot)
ges_dec = self, -- Ref to the current GestureDetector instance
}
self.contact_count = self.contact_count + 1
- --logger.dbg("New contact for slot", slot, "#contacts =", self.contact_count)
+ logger.dbg("New contact for slot", slot, "#contacts =", self.contact_count)
-- If we have a buddy contact, point its own buddy ref to us
if buddy_contact then
@@ -208,7 +208,7 @@ function GestureDetector:dropContact(contact)
self.active_contacts[slot] = nil
self.contact_count = self.contact_count - 1
- --logger.dbg("Dropped contact for slot", slot, "#contacts =", self.contact_count)
+ logger.dbg("Dropped contact for slot", slot, "#contacts =", self.contact_count)
end
function GestureDetector:dropContacts()
@@ -569,7 +569,7 @@ Emits both tap & double_tap gestures. Contact is up (but down is still true) or
--]]
function Contact:handleDoubleTap()
local slot = self.slot
- --logger.dbg("Contact:handleDoubleTap for slot", slot)
+ logger.dbg("Contact:handleDoubleTap for slot", slot)
local tev = self.current_tev
local gesture_detector = self.ges_dec
@@ -661,7 +661,7 @@ Handles move (switch to panState) & hold (switch to holdState). Contact is down.
--]]
function Contact:handleNonTap(new_tap)
local slot = self.slot
- --logger.dbg("Contact:handleNonTap for slot", slot)
+ logger.dbg("Contact:handleNonTap for slot", slot)
local tev = self.current_tev
local gesture_detector = self.ges_dec
@@ -887,7 +887,7 @@ end
Emits the swipe & multiswipe gestures. Contact is up. ST only (i.e., there isn't any buddy contact active).
--]]
function Contact:handleSwipe()
- --logger.dbg("Contact:handleSwipe for slot", self.slot)
+ logger.dbg("Contact:handleSwipe for slot", self.slot)
local tev = self.current_tev
local gesture_detector = self.ges_dec
@@ -942,7 +942,7 @@ end
Emits the pan gestures and handles their two finger variants. Contact is down (and either in holdState or panState).
--]]
function Contact:handlePan()
- --logger.dbg("Contact:handlePan for slot", self.slot)
+ logger.dbg("Contact:handlePan for slot", self.slot)
local tev = self.current_tev
local buddy_contact = self.buddy_contact
local gesture_detector = self.ges_dec
@@ -1045,7 +1045,7 @@ Emits the pan, two_finger_pan, two_finger_hold_pan, inward_pan, outward_pan & ro
Contact is down in panState or holdState, or up in panState if it was lifted below the swipe interval.
--]]
function Contact:handleTwoFingerPan(buddy_contact)
- --logger.dbg("Contact:handleTwoFingerPan for slot", self.slot)
+ logger.dbg("Contact:handleTwoFingerPan for slot", self.slot)
local gesture_detector = self.ges_dec
-- triggering contact is self
@@ -1164,7 +1164,7 @@ end
Emits the pan_release & two_finger_pan_release gestures. Contact is up (but down is still true) and in panState.
--]]
function Contact:handlePanRelease(keep_contact)
- --logger.dbg("Contact:handlePanRelease for slot", self.slot)
+ logger.dbg("Contact:handlePanRelease for slot", self.slot)
local tev = self.current_tev
local buddy_contact = self.buddy_contact
local gesture_detector = self.ges_dec
diff --git a/frontend/device/input.lua b/frontend/device/input.lua
index bb41156f6..7ec609cb8 100644
--- a/frontend/device/input.lua
+++ b/frontend/device/input.lua
@@ -178,6 +178,7 @@ local Input = {
-- touch state:
main_finger_slot = 0,
+ pen_slot = 4,
cur_slot = 0,
MTSlots = nil, -- table, object may be replaced at runtime
active_slots = nil, -- ditto
@@ -219,6 +220,10 @@ function Input:init()
},
}
+ -- Always send pen data to a slot far enough away from our main finger slot that it can never be matched with a finger buddy in GestureDetector (i.e., +/- 1),
+ -- with an extra bit of leeway, since we don't even actually support three finger gestures ;).
+ self.pen_slot = self.main_finger_slot + 4
+
self.gesture_detector = GestureDetector:new{
screen = self.device.screen,
input = self,
@@ -563,28 +568,33 @@ function Input:handleKeyBoardEv(ev)
end
elseif self.wacom_protocol then
if ev.code == C.BTN_TOOL_PEN then
- -- Always send pen data to slot 2
- self:setupSlotData(2)
+ logger.dbg("IN BTN_TOOL_PEN, curr_slot data:", self:getCurrentMtSlot())
if ev.value == 1 then
+ -- Switch to the dedicated pen slot
+ self:setupSlotData(self.pen_slot)
self:setCurrentMtSlot("tool", TOOL_TYPE_PEN)
else
self:setCurrentMtSlot("tool", TOOL_TYPE_FINGER)
+ -- Switch back to our main finger slot
+ self.cur_slot = self.main_finger_slot
end
+ logger.dbg("OUT BTN_TOOL_PEN, curr_slot data:", self:getCurrentMtSlot())
return
elseif ev.code == C.BTN_TOUCH then
+ logger.dbg("IN BTN_TOUCH, curr_slot data:", self:getCurrentMtSlot())
-- BTN_TOUCH is bracketed by BTN_TOOL_PEN, so we can limit this to pens, to avoid stomping on panel slots.
if self:getCurrentMtSlotData("tool") == TOOL_TYPE_PEN then
-- Much like on snow, use this to detect contact down & lift,
-- as ABS_PRESSURE may be entirely omitted from hover events,
-- and ABS_DISTANCE is not very clear cut...
- self:setupSlotData(2)
if ev.value == 1 then
- self:setCurrentMtSlot("id", 2)
+ self:setCurrentMtSlot("id", self.pen_slot)
else
self:setCurrentMtSlot("id", -1)
end
end
+ logger.dbg("OUT BTN_TOUCH, curr_slot data:", self:getCurrentMtSlot())
return
end |
Okay, I'd forgotten how half of this thing worked, this one should actually work: diff --git a/frontend/device/gesturedetector.lua b/frontend/device/gesturedetector.lua
index e71646fd9..7a59c600b 100644
--- a/frontend/device/gesturedetector.lua
+++ b/frontend/device/gesturedetector.lua
@@ -162,7 +162,7 @@ function GestureDetector:newContact(slot)
ges_dec = self, -- Ref to the current GestureDetector instance
}
self.contact_count = self.contact_count + 1
- --logger.dbg("New contact for slot", slot, "#contacts =", self.contact_count)
+ logger.dbg("New contact for slot", slot, "#contacts =", self.contact_count)
-- If we have a buddy contact, point its own buddy ref to us
if buddy_contact then
@@ -208,7 +208,7 @@ function GestureDetector:dropContact(contact)
self.active_contacts[slot] = nil
self.contact_count = self.contact_count - 1
- --logger.dbg("Dropped contact for slot", slot, "#contacts =", self.contact_count)
+ logger.dbg("Dropped contact for slot", slot, "#contacts =", self.contact_count)
end
function GestureDetector:dropContacts()
@@ -569,7 +569,7 @@ Emits both tap & double_tap gestures. Contact is up (but down is still true) or
--]]
function Contact:handleDoubleTap()
local slot = self.slot
- --logger.dbg("Contact:handleDoubleTap for slot", slot)
+ logger.dbg("Contact:handleDoubleTap for slot", slot)
local tev = self.current_tev
local gesture_detector = self.ges_dec
@@ -661,7 +661,7 @@ Handles move (switch to panState) & hold (switch to holdState). Contact is down.
--]]
function Contact:handleNonTap(new_tap)
local slot = self.slot
- --logger.dbg("Contact:handleNonTap for slot", slot)
+ logger.dbg("Contact:handleNonTap for slot", slot)
local tev = self.current_tev
local gesture_detector = self.ges_dec
@@ -887,7 +887,7 @@ end
Emits the swipe & multiswipe gestures. Contact is up. ST only (i.e., there isn't any buddy contact active).
--]]
function Contact:handleSwipe()
- --logger.dbg("Contact:handleSwipe for slot", self.slot)
+ logger.dbg("Contact:handleSwipe for slot", self.slot)
local tev = self.current_tev
local gesture_detector = self.ges_dec
@@ -942,7 +942,7 @@ end
Emits the pan gestures and handles their two finger variants. Contact is down (and either in holdState or panState).
--]]
function Contact:handlePan()
- --logger.dbg("Contact:handlePan for slot", self.slot)
+ logger.dbg("Contact:handlePan for slot", self.slot)
local tev = self.current_tev
local buddy_contact = self.buddy_contact
local gesture_detector = self.ges_dec
@@ -1045,7 +1045,7 @@ Emits the pan, two_finger_pan, two_finger_hold_pan, inward_pan, outward_pan & ro
Contact is down in panState or holdState, or up in panState if it was lifted below the swipe interval.
--]]
function Contact:handleTwoFingerPan(buddy_contact)
- --logger.dbg("Contact:handleTwoFingerPan for slot", self.slot)
+ logger.dbg("Contact:handleTwoFingerPan for slot", self.slot)
local gesture_detector = self.ges_dec
-- triggering contact is self
@@ -1164,7 +1164,7 @@ end
Emits the pan_release & two_finger_pan_release gestures. Contact is up (but down is still true) and in panState.
--]]
function Contact:handlePanRelease(keep_contact)
- --logger.dbg("Contact:handlePanRelease for slot", self.slot)
+ logger.dbg("Contact:handlePanRelease for slot", self.slot)
local tev = self.current_tev
local buddy_contact = self.buddy_contact
local gesture_detector = self.ges_dec
diff --git a/frontend/device/input.lua b/frontend/device/input.lua
index bb41156f6..71ae341d4 100644
--- a/frontend/device/input.lua
+++ b/frontend/device/input.lua
@@ -178,6 +178,7 @@ local Input = {
-- touch state:
main_finger_slot = 0,
+ pen_slot = 4,
cur_slot = 0,
MTSlots = nil, -- table, object may be replaced at runtime
active_slots = nil, -- ditto
@@ -219,6 +220,10 @@ function Input:init()
},
}
+ -- Always send pen data to a slot far enough away from our main finger slot that it can never be matched with a finger buddy in GestureDetector (i.e., +/- 1),
+ -- with an extra bit of leeway, since we don't even actually support three finger gestures ;).
+ self.pen_slot = self.main_finger_slot + 4
+
self.gesture_detector = GestureDetector:new{
screen = self.device.screen,
input = self,
@@ -563,28 +568,38 @@ function Input:handleKeyBoardEv(ev)
end
elseif self.wacom_protocol then
if ev.code == C.BTN_TOOL_PEN then
- -- Always send pen data to slot 2
- self:setupSlotData(2)
+ logger.dbg("IN BTN_TOOL_PEN, curr_slot data:", self:getCurrentMtSlot())
+ -- Switch to the dedicated pen slot, and make sure it's active, as this can come in a dedicated input frame
+ self:setupSlotData(self.pen_slot)
if ev.value == 1 then
self:setCurrentMtSlot("tool", TOOL_TYPE_PEN)
else
self:setCurrentMtSlot("tool", TOOL_TYPE_FINGER)
+ -- Switch back to our main finger slot
+ self.cur_slot = self.main_finger_slot
end
+ logger.dbg("OUT BTN_TOOL_PEN, curr_slot data:", self:getCurrentMtSlot())
return
elseif ev.code == C.BTN_TOUCH then
+ logger.dbg("IN BTN_TOUCH, curr_slot data:", self:getCurrentMtSlot())
-- BTN_TOUCH is bracketed by BTN_TOOL_PEN, so we can limit this to pens, to avoid stomping on panel slots.
if self:getCurrentMtSlotData("tool") == TOOL_TYPE_PEN then
+ -- Make sure the pen slot is active, as this can come in a dedicated input frame
+ -- (i.e., we need it to be referenced by self.MTSlots for the lift to be picked up in the EV_SYN:SYN_REPORT handler).
+ -- (Conversely, getCurrentMtSlotData pokes at the *persistent* slot data in self.ev_slots,
+ -- so it can keep track of data across input frames).
+ self:setupSlotData(self.pen_slot)
-- Much like on snow, use this to detect contact down & lift,
-- as ABS_PRESSURE may be entirely omitted from hover events,
-- and ABS_DISTANCE is not very clear cut...
- self:setupSlotData(2)
if ev.value == 1 then
- self:setCurrentMtSlot("id", 2)
+ self:setCurrentMtSlot("id", self.pen_slot)
else
self:setCurrentMtSlot("id", -1)
end
end
+ logger.dbg("OUT BTN_TOUCH, curr_slot data:", self:getCurrentMtSlot())
return
end |
CRASH5_penpatch4.txt I don't know if this was related to the previous patch (number 2), but after I exited from KOReader, Kindle UI did not respond to my finger. It also did not respond to the pen itself, however... I pressed and held the pen button and then it DID respond! :D So I was able to start KOReaeder again (after applying the patch 4). Now I wonder, if in the cases with these freezes in #11482 Kindle will respond to the pen button touches, I just never tried :D |
I tried quitting KOReader again, after patch 4 - the same thing :D only button-press pen works in Kindle UI, but everything works OK in KOReader itself. Is there a chance that touch input was not given back by KOReader or something? |
Nope, we release the grab on exit (as does the kernel if we crash). As for the rest, it might simply be the stock system losing track of the the state of things for some reason, and a button press helping steer it on the right path again. In any case, #notourbug (and it's entirely unrelated to these patches, so I have no idea why the behavior would be new). |
If there's only one contact, we won't get an ABS_MT_SLOT, so we need to make sure we fall back to the main finger slot once we've caught a tool switch. Also, move the dedicated pen slot further away, so it has zero chance of being detected as a potential buddy contact to a finger contact. Fix koreader#11514
) If there's only one contact, we won't get an ABS_MT_SLOT, so we need to make sure we fall back to the main finger slot once we've caught a tool switch. Also, move the dedicated pen slot further away, so it has zero chance of being detected as a potential buddy contact to a finger contact. Fix #11514
So, yesterday, I quit KOReader again, and pen by itself worked, finger still didn't respond. I don't really know what is going on :D |
(Moved to respective ticket: #11482 (comment)) |
Hey guys,
Sorry, I fell behind all the updates recently. On KOReader 2024.01-80 I see this symbol in the upper left corner when I swipe through pages in mupdf. Is this a new feature? What does it do?
Thanks!
The text was updated successfully, but these errors were encountered: