Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 09-20-2021, 09:13 AM   #1
arooni
Addict
arooni began at the beginning.
 
Posts: 315
Karma: 26
Join Date: Jul 2012
Device: Kindle Paperwhite 4 (2018)
Will Bluetooth hardware keyboards ever be supported?

I have a boox nova air arriving today and plan on reading mostly with koreader. I think I had asked this before on GitHub but was wondering if hardware keyboards would be supported. Would be very handy for taking notes on a highlighted passage i'd like to recall later
arooni is offline   Reply With Quote
Old 09-20-2021, 03:56 PM   #2
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,406
Karma: 2451781
Join Date: Apr 2014
Device: BQ Cervantes 4
Quote:
Originally Posted by arooni View Post
I have a boox nova air arriving today and plan on reading mostly with koreader. I think I had asked this before on GitHub but was wondering if hardware keyboards would be supported. Would be very handy for taking notes on a highlighted passage i'd like to recall later
It is doable but not trivial to implement.

There're no native methods that emulate what https://developer.android.com/refere...nicodeChar(int) does and include a JNI call each time a key is pressed is too costly and leads to missing keystrokes.

We might need to implement this the other way around (proccesing all keystrokes while we're in inputText state and send the resulting code to our lua loop using a named pipe, pretty much like we're already doing for generic android broadcasts in https://github.com/koreader/android-...entReceiver.kt).

If some developer is willing to do the job please open a new ticket in https://github.com/koreader/android-luajit-launcher. What's required for the task is familiarity with android SDK (or programming in general and willing to learn a new platform) and a few free hours to tinker and test solutions.

TL;DR: No ETA, patches welcome.
pazos is offline   Reply With Quote
Advert
Old 09-21-2021, 05:24 AM   #3
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,745
Karma: 730681
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
There has to be a way to avoid dealing with direct button events? Similar to how pasting works on Android, and how we've done the input on SDL. Because implementing keyboard layouts other than QWERTY (or whatever the dev prefers) would be patently ridiculous.
Frenzie is offline   Reply With Quote
Old 09-21-2021, 04:22 PM   #4
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,406
Karma: 2451781
Join Date: Apr 2014
Device: BQ Cervantes 4
Quote:
Originally Posted by Frenzie View Post
There has to be a way to avoid dealing with direct button events? Similar to how pasting works on Android, and how we've done the input on SDL. Because implementing keyboard layouts other than QWERTY (or whatever the dev prefers) would be patently ridiculous.
Copy / paste also goes through JNI but it is cheap because it is impossible for the user to copy/paste stuff a few times per second.

The input model of the SDL port is what I had in mind when I talked about "getUnicodeChar". The function can be called through JNI from https://github.com/koreader/koreader...droid.lua#L115. We just need to get a few more values from "android.lib.AKeyEvent_*" such as the key modifiers aplied for current stroke.

The function will return 0 if the key isn't intended to be translated to unicode (ie: the back key) and a positive value that can be casted to a char otherwise.

That unicode char already handles keyboard l10n/distribution and works for both hardware keyboards and other IMEs.

It just happens it is slow to be called in that loop, even if we do that only when we want to register keyboard events, like we're doing on SDL.

So my suggestion would be: in inputState mode we don't consume key events in native code so they can be sent to managed code where we can do getUnicodeChar without the JNI penalty.

Please do notice that, with current approach, almost all key events won't be catched from JVM as we do consume them in https://github.com/koreader/koreader...droid.lua#L208
pazos is offline   Reply With Quote
Old 09-22-2021, 03:49 AM   #5
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,745
Karma: 730681
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
I have to say I find it surprising that it's so slow that you'd actually notice it, rather than slow in the 10 ms is an absolute eternity to handle a little keypress but you'd probably never notice it sense.
Frenzie is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
best solution for remote page turns? phone? bluetooth selfie remote? bluetooth mouse arooni Onyx Boox 2 09-13-2021 08:07 PM
Do the T65s or T63s support bluetooth keyboards? vagabondvivant Boyue 0 11-22-2019 01:13 PM
InkBook Prime - Does it support Bluetooth-Keyboards? openairwriter More E-Book Readers 7 08-12-2017 09:44 AM
Bouyue T62D Bluetooth hardware: yes or no? JNT Android Developer's Corner 2 10-31-2016 05:36 PM
HD BlueTooth Keyboards ... Help Barbara1955 Kindle Fire 1 12-18-2014 09:16 AM


All times are GMT -4. The time now is 01:37 AM.


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