Huh well that took a while of debugging.
I was injecting/writing to the touchscreen events, but sometimes previous page/next page would still be incorrect.
In landscape view, X returns the current landscape res. Ok.
But it turns out that we always need the portrait res when writing to the input device, since the touch device uses portrait coordinates, regardless of X.
When simply using the XTestFakeMotionEvent() to fake a mouse/touch, I didn't have to worry about it.
So, switching to the 'better' fake touch that will work with KOReader wasn't as easy as I thought! (It would have been no work if I pretended landscape mode didn't exist)
Anyway, I didn't do anything about the brightness not working in voyage (oasis I assume too) - but I plan to fix. Thankfully it's something minor and brightness isn't needed to be changed very often!
KindleLazy 0.9 is better:
It supports waking up the kindle if it is in screensaver mode (on 'my' remote, it is set to the first/top button of the controller)
It works in KOReader
But it doesn't work properly in upside down mode... and at the moment I can't think of a nice way to fix this.
(The input is reversed)
And still sometimes the input is not corrected when we enter upside down mode...
(Still no brightness for voyage if using my remote I think!)
https://github.com/llakssz/KindleLaz...leLazy-0.9.zip
I just tested and KOReader doesn't work...........
I have no idea why, since I am actually writing the event to the input device file... strange.
Ok, and bit more testing...
Even changing the brightness doesn't work, and that doesn't use the touch screen, it just execute commands.
I assume KOReader is receiving and blocking inputs or something, so that they are not getting through.
If NiLuJe can say anything about this, about how likely it would be to get around this, I might revert to the older method of touch/page turning, so there are no problems with upside down mode.