PW On-Screen Keyboard: Using the line above the keys?
My findings regarding the word prediction line of the virtual K*ndle keyboard:
It is enabled by setting the last value (called "flag" in the below template) of the keyboard activation command to 1:
lipc-set-prop -s com.lab126.keyboard open <destination>:<mode>:<flag>
Example:
lipc-set-prop -s com.lab126.keyboard open net.my.stuff:abc:1
However, AFAIK, the K*ndle apps do not manipulate the word prediction line based on actual app content. As described in the K5 hacking wiki, only libpredictor.so is used for typing prediction.
This makes it less useful for use in an interactive fiction interpreter.
The communication between keyboard binary and app is done via lipc. The app has to implement these lipc properties:
[root@kindle root]# lipc-probe -v com.amazon.kindle.inputMethod
w Str keyboardSetPreeditString
w Str keyboardReplace
w Str keyboardGetSurround
w Str keyboardCommit
w Str keyboardDelete
I have not yet determined how all of these properties work (i.e. how they have to be formatted in order to work). But:
-keyboardCommit expects simply the string to append to the input line of a lipc-ready app.
-keyboardDelete expects a string like '4:0', which means that 4 chars will be deleted from a lipc ready app. I don’t know yet what the number after the colon means. But it has to be there.
In order to determine how the others work, I plan to implement callbacks for these properties in the app to find out what the keyboard actually sends.
Anyway, I am doubtful that such a static word prediction based on a predefined library (libpredict) would be helpful in an interactive fiction app. My original goal/intention was to put words there, that are actually part of the descriptive text of the game, or part of the command history of the player.
Last edited by pete330; 06-07-2017 at 09:56 AM.
|