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 06-10-2019, 02:05 PM   #1036
jhh
Member
jhh began at the beginning.
 
Posts: 15
Karma: 10
Join Date: May 2019
Device: KT4
Ok, @NiLuJe and @ilovejedd, thanks a lot for your work so far!
jhh is offline   Reply With Quote
Old 06-10-2019, 02:48 PM   #1037
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,613
Karma: 724945
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Quote:
Originally Posted by NiLuJe View Post
Can you try this random shot in the dark patch (based on the fact that the KT4 output looks eerily similar to the one from Kobo's Mk. 7 devices):
That can't work. For a quick test, it should be something like this. (See here why not.)

Code:
diff --git a/frontend/device/kindle/device.lua b/frontend/device/kindle/device.lua
index 501d0735..2505f8dc 100644
--- a/frontend/device/kindle/device.lua
+++ b/frontend/device/kindle/device.lua
@@ -755,6 +755,7 @@ function KindleBasic3:init()
 
     Kindle.init(self)
 
+    self.input.snow_protocol = true
     self.input.open(self.touch_dev)
     self.input.open("fake_events")
 end

Last edited by Frenzie; 06-10-2019 at 02:51 PM.
Frenzie is offline   Reply With Quote
Advert
Old 06-10-2019, 05:01 PM   #1038
jhh
Member
jhh began at the beginning.
 
Posts: 15
Karma: 10
Join Date: May 2019
Device: KT4
Quote:
Originally Posted by Frenzie View Post
That can't work. For a quick test, it should be something like this. (See here why not.)

Code:
diff --git a/frontend/device/kindle/device.lua b/frontend/device/kindle/device.lua
index 501d0735..2505f8dc 100644
--- a/frontend/device/kindle/device.lua
+++ b/frontend/device/kindle/device.lua
@@ -755,6 +755,7 @@ function KindleBasic3:init()
 
     Kindle.init(self)
 
+    self.input.snow_protocol = true
     self.input.open(self.touch_dev)
     self.input.open("fake_events")
 end
I've modified \koreader\frontend\device\kindle\device.lua according to this patch and now it works perfectly!


(I don't have account at github so I won't comment there.)

Last edited by jhh; 06-10-2019 at 05:03 PM.
jhh is offline   Reply With Quote
Old 06-10-2019, 05:16 PM   #1039
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,613
Karma: 724945
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Great! As soon as #5071 is merged it'll show up in the following nightly. Until then (in one or two days) it'd be best not to update.
Frenzie is offline   Reply With Quote
Old 06-11-2019, 08:44 AM   #1040
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Duh. Stupidly simple indeed! Thanks, Frenzie!
NiLuJe is offline   Reply With Quote
Advert
Old 06-11-2019, 10:05 AM   #1041
shamanNS
Guru
shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.
 
Posts: 884
Karma: 10113994
Join Date: Feb 2010
Location: Serbia
Device: Kindle PW5 [bricked], Kindle PW1
Quote:
Originally Posted by Frenzie View Post
Not only is it not a syntax error, but removing trailing commas is bad practice.

Code:
return {
    ["cre_header_status_font_size"] = 40,
    ["copt_line_spacing"] = 110,
    ["disable_double_tap"] = true,
    ["copt_render_dpi"] = 300,
    ["start_with"] = "last",
    ["disable_kobolight"] = true,
    ["cre_header_status_font_size"] = 30,
    ["full_refresh_count"] = 12,
    ["larger_tap_area_to_follow_links"] = true,
    ["copt_b_page_margin"] = 10,
}
If it was not obvious I was referring to that single comma marked in red color.
So, are you telling me that Lua (or whatever language's 'data structure' / collection/list/array type that code snippet represents) is different than almost any other language under the Sun (even CSS properties list! respect those same conventions) where any type of "enumerating stuff" shouldn't end with a comma as that results in syntax error or parsing error?
Even when returning multiple things as separate objects you wouldn't end that statement with a comma.

Last edited by shamanNS; 06-11-2019 at 10:08 AM.
shamanNS is offline   Reply With Quote
Old 06-11-2019, 10:17 AM   #1042
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,271
Karma: 2189337
Join Date: Apr 2014
Device: BQ Cervantes 4
It is a bad practice because a) it isn't needed and b) can cause problems if someone adds a n+1 element to the returned table.

It is like in C, where
Code:
if(something) return true; else return false;
is valid but a bad practice because in the moment of extending one of the statements it will become non-valid.

So unless you're sure that you always want a single return statement then the following is recommended
Code:
if(something) {return true;} else {return false;}
We can argue that braces are not needed in this particular example, like the comma in your sample case.
pazos is offline   Reply With Quote
Old 06-11-2019, 10:46 AM   #1043
shamanNS
Guru
shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.
 
Posts: 884
Karma: 10113994
Join Date: Feb 2010
Location: Serbia
Device: Kindle PW5 [bricked], Kindle PW1
I personally hate people that are omitting curly braces for single statement if/else blocks just as much as I hate people that are omitting parentheses when assigning "arrow functions" that take only one argument to a variable or a constant (even though that particular case is mainly "just" offence in regards to code readability /glanceability. )



But this comma convention thing (in most language that is not optional...) is one of the rare things that are shared between most of the languages... or so I believed
shamanNS is offline   Reply With Quote
Old 06-11-2019, 11:03 AM   #1044
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,613
Karma: 724945
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Quote:
Originally Posted by shamanNS View Post
So, are you telling me that Lua (or whatever language's 'data structure' / collection/list/array type that code snippet represents) is different than almost any other language under the Sun (even CSS properties list! respect those same conventions) where any type of "enumerating stuff" shouldn't end with a comma as that results in syntax error or parsing error?
It's not a syntax error in Java (although it used to be at some point in now ancient implementations), JavaScript (unless you still need <=IE8), C#, Python, Ruby, Perl, PHP, etc. And of course it's not a syntax error in Lua either.

If I'm not mistaken, C89 and C++11 allow for it too. Why older C++ wouldn't… I have no idea.

Quote:
Originally Posted by pazos View Post
We can argue that braces are not needed in this particular example, like the comma in your sample case.
Yup, I'm always annoyed when I come across if statements without curly braces. Not because they are necessary as written because obviously they're not right there and then, but because I have to go about adding braces first instead of just quickly adding whatever I want to add.

Besides avoiding some hopefully minor annoyance (although with curly braces you can get undetected wrong behavior), both curly braces and trailing commas have the diff issue, in that you get some useless noise in your diffs. Again not a big deal, but still a minor annoyance that's nicer to do without.

So:

1. Fewer unintended errors, whether benign (syntax) or harmful (behavior).
2. Cleaner diffs.
3. Less effort. You could see this as a restatement of 1 and 2, but not exactly. I think I'm fairly safe these days from harmful errors introduced by 1 (through bad experience!), but I'm still annoyed at the minor effort of having to add braces or commas. You could also sort the list alphabetically using your editor if desired without running into 1, so I think it's worth making it a separate point.

Therefore languages that don't allow for trailing commas slightly annoy me.

CSS is a bit different though, depending on the specifics. I'm not generally annoyed by it.

Quote:
Originally Posted by shamanNS View Post
I personally hate people that are omitting curly braces for single statement if/else blocks just as much as I hate people that are omitting parentheses when assigning "arrow functions" that take only one argument to a variable or a constant (even though that particular case is mainly "just" offence in regards to code readability /glanceability
I think it's fine (for readability, anyway) if it's indented properly. To take the code from above:

Code:
if(something)
  return true;
else
  return false;
However, the problem now becomes that the indentation is misleading.

Code:
if(something)
  bla;
  // this is always executed
  blabla;
In that sense the way Python works is nice, although mostly it annoys me. I really like being able to do something like:

Code:
if (something) {
  indented();
quick_debug();
  indented_orig();
}
I think that makes it easier to work with.

tl;dr I prefer Lua over Python in many ways even though they seem superficially similar, and this is one of them.

Last edited by Frenzie; 06-11-2019 at 11:17 AM.
Frenzie is offline   Reply With Quote
Old 08-04-2019, 01:39 AM   #1045
aaronwi
Junior Member
aaronwi began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2019
Device: N/A
Is there a way to make koreader the default opener for files on the pw2? seems quite tedious to open kual then koreader, then file manager, and go through author folders to find the file.
aaronwi is offline   Reply With Quote
Old 08-04-2019, 02:54 AM   #1046
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
That'd be KPVBooklet, which is documented in the GitHub Wiki, and should behave mostly fine (spoiler alert: never used it myself) as long as you stay away from FW >= 5.8
NiLuJe is offline   Reply With Quote
Old 02-09-2020, 08:50 AM   #1047
makara
Connoisseur
makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'
 
makara's Avatar
 
Posts: 78
Karma: 10000
Join Date: Jul 2012
Location: Israel
Device: KA1, KLH2O, Oasis 3
On the latest version 2020.01, the menu items "Autosuspend timeout" and "Autoshutdown timeout" disappeared. Version for Kobo and for Kindle.
In the forum thread for Kobo, I have already talked about this problem. Everything worked out there, thanks PAZOC. But for the Kindle PW2 it doesn’t work. No plugins "Autosuspend timeout" end "Autoshutdown timeout" listed.
makara is offline   Reply With Quote
Old 02-09-2020, 08:55 AM   #1048
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,613
Karma: 724945
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
That's correct, it's only enabled on select devices:
https://github.com/koreader/koreader...main.lua#L3-L5
Frenzie is offline   Reply With Quote
Old 02-09-2020, 09:11 AM   #1049
makara
Connoisseur
makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'makara knows the difference between 'who' and 'whom'
 
makara's Avatar
 
Posts: 78
Karma: 10000
Join Date: Jul 2012
Location: Israel
Device: KA1, KLH2O, Oasis 3
Too bad there is no for KPW2. I hope someday will be.
makara is offline   Reply With Quote
Old 02-09-2020, 11:42 AM   #1050
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
PRs welcome .

(Kindles are known to have some wonky rtcs and/or a couple of 'em in some cases, which would make supporting more than one specific model potentially non-trivial).

Plus, the fact that the stock system is still alive behind us would *probably* render this kind of thing inoperable anyway ^^.
NiLuJe is offline   Reply With Quote
Reply

Tags
application, k5 tools, kindle, launcher add-ons, lua, reader, touch

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
KOReader: a document reader for PDF, DJVU, EPUB, FB2, HTML, ... (GPLv3) hawhill Kindle Developer's Corner 1269 02-27-2024 11:49 AM
PocketBook-KOReader: a document reader for PDF, DJVU, EPUB, FB2, CBZ, ... (AGPLv3) chrox KOReader 564 02-21-2024 02:17 PM
KPV: a PDF reader for Kindle, based on muPDF, GPLv3 hawhill Kindle Developer's Corner 1056 11-11-2017 03:07 AM
Hacked Up Reader for epub/fb2/txt/rtf/html/pdb/etc bhaak Kindle Developer's Corner 296 10-01-2016 01:11 PM
A real PDF to epub/djvu/rtf/html software?. DsOft ePub 35 01-02-2011 03:57 PM


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


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