Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 02-24-2018, 04:09 AM   #46
Frenzie
Evangelist
Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.
 
Posts: 443
Karma: 111542
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Most Kobos have mirrored coordinates. You can always try:

Code:
touch_mirrored_x = false,
But without regular touch working I suppose it's hard to say if it's just an odd side effect.
Frenzie is offline   Reply With Quote
Old 02-25-2018, 06:35 PM   #47
cola
Junior Member
cola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toys
 
Posts: 5
Karma: 5814
Join Date: Feb 2018
Device: Kobo Aura H2O2
Okay, I got it to work I think. The code seems to be written on the premise that the machine is going to tell you if a finger has been taken off. That doesn't seem to be true for the H2O2. It has event logs like this for single touch events:

Spoiler:
02/25/18-17:45:49 DEBUG input event => type: 3, code: 57(nil), value: 0, time: 568.374986
02/25/18-17:45:49 DEBUG input event => type: 3, code: 59(SleepCover), value: 0, time: 568.374989
02/25/18-17:45:49 DEBUG input event => type: 3, code: 53(nil), value: 739, time: 568.374992
02/25/18-17:45:49 DEBUG input event => type: 3, code: 54(nil), value: 534, time: 568.374995
02/25/18-17:45:49 DEBUG input event => type: 3, code: 58(nil), value: 22, time: 568.374996
02/25/18-17:45:49 DEBUG input event => type: 3, code: 48(nil), value: 0, time: 568.375000
02/25/18-17:45:49 DEBUG input event => type: 3, code: 49(nil), value: 0, time: 568.375001
02/25/18-17:45:49 DEBUG input event => type: 3, code: 52(nil), value: 0, time: 568.375002
02/25/18-17:45:49 DEBUG input event => type: 0, code: 2(nil), value: 0, time: 568.375004
02/25/18-17:45:49 DEBUG input event => type: 0, code: 0(nil), value: 0, time: 568.375038

But when a finger leaves the screen, it doesn't send anything with an id of -1, it just stops reporting that finger. If there are no fingers on the screen, it sends one SYN_REPORT message:

02/25/18-17:45:49 DEBUG input event => type: 0, code: 0(nil), value: 0, time: 568.579338

by itself without any ABS events.

So, I changed Input:handleTouchEv so that it always passed every slot to feedEvent, and set all the ids to -1 after it passed them. Also, I turned off the thing that subtracts one from every id in adjustTouchAlyssum. That seems to work for single touch. The function now looks like this:

Spoiler:
Code:
function Input:handleTouchEv(ev)
    if ev.type == EV_ABS then
        if #self.MTSlots == 0 then
            table.insert(self.MTSlots, self:getMtSlot(self.cur_slot))
        end
        if ev.code == ABS_MT_SLOT then
            if self.cur_slot ~= ev.value then
                table.insert(self.MTSlots, self:getMtSlot(ev.value))
            end
            self.cur_slot = ev.value
        elseif ev.code == ABS_MT_TRACKING_ID then
            self:setCurrentMtSlot("id", ev.value)
        elseif ev.code == ABS_MT_POSITION_X then
            self:setCurrentMtSlot("x", ev.value)
        elseif ev.code == ABS_MT_POSITION_Y then
            self:setCurrentMtSlot("y", ev.value)

        -- code to emulate mt protocol on kobos
        -- we "confirm" abs_x, abs_y only when pressure ~= 0
        elseif ev.code == ABS_X then
            self:setCurrentMtSlot("abs_x", ev.value)
        elseif ev.code == ABS_Y then
            self:setCurrentMtSlot("abs_y", ev.value)
        elseif ev.code == ABS_PRESSURE then
            if ev.value ~= 0 then
                self:setCurrentMtSlot("id", 1)
                self:confirmAbsxy()
            else
                self:cleanAbsxy()
                self:setCurrentMtSlot("id", -1)
            end
        end
    elseif ev.type == EV_SYN then
        if ev.code == SYN_REPORT then
            for _, MTSlot in pairs(self.MTSlots) do
                self:setMtSlot(MTSlot.slot, "timev", TimeVal:new(ev.time))
            end
            self.MTSlots = {}
            for _, slot in pairs(self.ev_slots) do
                table.insert(self.MTSlots, slot)
            end
            -- feed ev in all slots to state machine
            local touch_ges = self.gesture_detector:feedEvent(self.MTSlots)
            self.MTSlots = {}
            for _, slot in pairs(self.ev_slots) do
                slot.id = -1
            end
            if touch_ges then
                self:gestureAdjustHook(touch_ges)
                return Event:new("Gesture",
                    self.gesture_detector:adjustGesCoordinate(touch_ges)
                )
            end
        end
    end
end
in input.lua and
Code:
local adjustTouchAlyssum = function(self, ev)
    ev.time = TimeVal:now()
end
in device.lua (removing the if part)

I also added touch_mirrored_x=false, to the device section.

This makes touch work, although I seem to have broken the hold gesture.

By the way, this might explain why the two-finger procedure worked:
Spoiler:
The first tap had id 0 - 1 = -1, the second one had id 1 - 1 = 0, and when you took your finger off, all that was left was a tap with id "-1", which was what the machine was looking for to tell it that your finger had left the screen! And I guess it looked at the coordinates of that event to tell it where the tap had been, which is why the first finger is the place where the tap registered. That also explains why dragging or holding followed the second finger.

Last edited by cola; 02-25-2018 at 06:51 PM. Reason: come to think of it, this probably explains why the thing with two fingers registered as a one-finger tap
cola is offline   Reply With Quote
Advert
Old 02-25-2018, 08:14 PM   #48
cola
Junior Member
cola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toys
 
Posts: 5
Karma: 5814
Join Date: Feb 2018
Device: Kobo Aura H2O2
Okay, I got the hold button to work. Here is the output of diff -r from the tree of koreader-kobo-arm-kobo-linux-gnueabihf-v2015.11-1523-g78284e1.zip (with inessential stuff removed):

Spoiler:
Code:
diff -r koreader/frontend/device/input.lua koreader2/frontend/device/input.lua
413a414,422
>                 self:setMtSlot(MTSlot.slot, "unused", nil)
>             end
>             self.MTSlots = {}
>             for _, slot in pairs(self.ev_slots) do
>                 table.insert(self.MTSlots, slot)
>                 if slot.unused then
>                     slot.id = -1
>                     slot.timev = TimeVal:new(ev.time)
>                 end
417a427,429
>             for _, slot in pairs(self.ev_slots) do
>                 slot.unused = true
>             end
479a492,495
>             self.MTSlots = {}
>             for _, slot in pairs(self.ev_slots) do
>                 table.insert(self.MTSlots, slot)
>             end
482a499,501
>             for _, slot in pairs(self.ev_slots) do
>                 slot.id = -1
>             end
diff -r koreader/frontend/device/kobo/device.lua koreader2/frontend/device/kobo/device.lua
107a108
>     touch_mirrored_x = false,
272c273
<         ev.value = ev.value - 1
---
>         ev.value = ev.value
cola is offline   Reply With Quote
Old 02-26-2018, 03:39 AM   #49
Frenzie
Evangelist
Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.
 
Posts: 443
Karma: 111542
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Unfortunately as is that doesn't work on older devices. I'm not sure if I have time to look at the specifics right now.

Code:
./luajit: frontend/device/gesturedetector.lua:124: attempt to index field 'timev' (a nil value)
stack traceback:
	frontend/device/gesturedetector.lua:124: in function 'deepCopyEv'
	frontend/device/gesturedetector.lua:239: in function <frontend/device/gesturedetector.lua:227>
	frontend/device/gesturedetector.lua:107: in function 'feedEvent'
	frontend/device/input.lua:497: in function 'waitEvent'
	frontend/ui/uimanager.lua:741: in function 'handleInput'
	frontend/ui/uimanager.lua:789: in function 'run'
	./reader.lua:190: in main chunk
	[C]: at 0x00013fc5
Git branch here.
Frenzie is offline   Reply With Quote
Old 02-27-2018, 09:00 AM   #50
cola
Junior Member
cola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toyscola shares his or her toys
 
Posts: 5
Karma: 5814
Join Date: Feb 2018
Device: Kobo Aura H2O2
I wasn't really intending it as a patch, I just thought it would be an easy way of explaining what was up with my ereader. And whoops, the changes in handleTouchEvPhoenix are there by accident!

I would rather not try to debug multitouch, write a proper patch with a configuration option in device.lua, etc, since my only development environment is my ereader itself. If someone else with an H2O2 is in a similar situation, maybe try it and tell me if it works?
cola is offline   Reply With Quote
Advert
Old 03-01-2018, 03:28 AM   #51
bandario
Junior Member
bandario began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2018
Device: H2O Edition 2
Ok, so this is not a very productive first post but I'll throw my hat in the ring as I am on the verge of returning my H2O2.

I am very familiar with doing weird and wonderful things with my android devices from custom firmware through XPOSED and even a little dabble in making a couple of customised roms for myself.

I have NO idea how to try this out on my H2O2 but I absolutely need this if I am going to keep this device: I can't read PDFs at all with the stock system.

If I need even a little bit of zoom, the whole show just becomes useless.


Does anyone think they could put this into simple step-by-step process from start to finish so that I can test these changes on my H2o2?


Please and thank you in advance if anyone can help at all.
bandario is offline   Reply With Quote
Old 03-01-2018, 03:59 AM   #52
Frenzie
Evangelist
Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.
 
Posts: 443
Karma: 111542
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
You need to apply these changes.

At the time of writing, that means overwriting the following files with those from the links should work according to cola:
frontend/device/input.lua
frontend/device/kobo/device.lua
Frenzie is offline   Reply With Quote
Old 03-01-2018, 04:32 AM   #53
bandario
Junior Member
bandario began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2018
Device: H2O Edition 2
Ok, thank you very much.

For the H2O2, are the recommended installation instructions on GitHub (install Kobo start menu first) still the recommended way to proceed?
bandario is offline   Reply With Quote
Old 03-01-2018, 05:29 AM   #54
bandario
Junior Member
bandario began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2018
Device: H2O Edition 2
By Odin's beard, Cola and Frenzie you have done it!

Works an absolute treat. Not quite the custom Android OS I was hoping for, but this handles PDFs much, much better than the stock software!

Many, many thanks.

So, here's your confirmation that this works on another H2O2 unit. Champions!

EDIT: For all passers by: yes, install Kobo Start Menu first. This operates outside of your normal ereader OS.
bandario is offline   Reply With Quote
Old 03-01-2018, 06:05 AM   #55
gilali
Enthusiast
gilali can read faster than his screen refreshesgilali can read faster than his screen refreshesgilali can read faster than his screen refreshesgilali can read faster than his screen refreshesgilali can read faster than his screen refreshesgilali can read faster than his screen refreshesgilali can read faster than his screen refreshesgilali can read faster than his screen refreshesgilali can read faster than his screen refreshesgilali can read faster than his screen refreshesgilali can read faster than his screen refreshes
 
Posts: 45
Karma: 14236
Join Date: Oct 2017
Location: Paris
Device: KoboAura2, KoboH2Ov2]
Thumbs up

ohhhh **** !!!!

Many thanks ! Thank you so much guys ! You are real WARRIORS

It's not christmas today, not my birthday too, but what a gift !!!!
gilali is offline   Reply With Quote
Old 03-01-2018, 06:24 AM   #56
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 52,345
Karma: 47514599
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
Does this mean that KSM09 and KOReader now work on the H2O2?
JSWolf is offline   Reply With Quote
Old 03-01-2018, 09:28 AM   #57
Frenzie
Evangelist
Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.
 
Posts: 443
Karma: 111542
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Is there anybody with something like a Kobo Mini, Aura HD or Glo or even a Kindle who can try this file to see if it works? Just curious.

frontend/device/input.lua

@JSWolf
Not out of the box, but close. Based on reading the comment about the kernel this might actually be fixing a bug in our logic.


@cola
Taking a closer look at your patch, I noticed the nonsensical sounding `ev.value = ev.value`. Logically I think that means you should just get rid of the alyssum_protocol?
Frenzie is offline   Reply With Quote
Old 03-01-2018, 10:00 AM   #58
Ken Maltby
Wizard
Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.
 
Ken Maltby's Avatar
 
Posts: 4,254
Karma: 6221252
Join Date: Dec 2009
Location: The Heart of Texas
Device: JetBook Lite (retired), AuraHD, PDA,
Seems to make no difference on my AuraHD, is there anything I should be looking for?

Luck;
Ken
Ken Maltby is offline   Reply With Quote
Old 03-01-2018, 10:32 AM   #59
Frenzie
Evangelist
Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.Frenzie knows the difference between a duck.
 
Posts: 443
Karma: 111542
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
If it doesn't break anything (regular tap, hold on word, hold and drag to select a bunch of text, slide left/right, pan document, other gestures like diagonal for screenshot) then perhaps we can just use it as is.
Frenzie is offline   Reply With Quote
Old 03-01-2018, 11:20 AM   #60
Ken Maltby
Wizard
Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.Ken Maltby ought to be getting tired of karma fortunes by now.
 
Ken Maltby's Avatar
 
Posts: 4,254
Karma: 6221252
Join Date: Dec 2009
Location: The Heart of Texas
Device: JetBook Lite (retired), AuraHD, PDA,
OK;

Regular tap=OK
Hold and drag=OK
Slide and Pan= ? don't know how to do that.
Screenshot=OK both epub & PDF

File Browser ev seem to work as well.

Luck;
Ken

Last edited by Ken Maltby; 03-01-2018 at 11:27 AM.
Ken Maltby is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
H2O2 Edition 2 Release Date? (Australia) meeera Kobo Reader 12 09-21-2017 05:23 AM
Kobo Aura H2O 2nd Edition vs old Kobo Aura H2O screen dimentions. iXPert12 Kobo Reader 1 09-18-2017 09:35 AM
Errors with EPUB rendering on Kobo Aura H2O running koreader-stable-v2015.11 algernonramone KOReader 8 03-16-2016 12:55 AM
[Aura H2O 3.18.0] Koreader/Coolreader Font Problems for a specific .epub Gnorr Kobo Reader 3 10-09-2015 04:11 AM
Koreader (latest install instructions) on H2O JSWolf KOReader 15 12-04-2014 09:32 PM


All times are GMT -4. The time now is 10:39 AM.


MobileRead.com is a privately owned, operated and funded community.