class FKCoreXR
Main interface for the Predictive Text SDK package
Methods | |
---|---|
void |
StartFleksySDK(string licenseKey, string licenseSecret, string layout_def="", string language_path="") Initialise Predictive Text SDK API. |
void |
setListener(FKCoreListener listener) Sets the prediction listener |
void |
CurrentWordPrediction(string context, int cursorStart, int cursorEnd) |
void |
NextWordPrediction(string context, int cursorStart, int cursorEnd) |
void |
startSwipe() |
void |
sendSwipeTypePoint(float x, float y) |
void |
stopSwipe() |
public void StartFleksySDK(string licenseKey, string licenseSecret, string layout_def="", string language_path="")
Initialise Predictive Text SDK API.
Parameters | |
---|---|
string licenseKey | Your license key, obtained from the developer portal |
string licenseSecret | Your license secret, obtained from the developer portal |
string layout_def | The keyboard layout in json format |
string language_path | The language file to be used |
The layout definition is a json string containing the position of each key (defined by a label and its accents) in the layout shown to the user. By default, FKCoreXR works with a standard key layout and on a keyboard defined in a 320 x 288 rectangle:
[
{
"labels":["q","1"],
"x":16,
"y":16,
"width":36,
"height":32
}
...
]
To define use the language_path argument you should point to a file that must be in Unity’s folder StreamingAssets/encrypted
and that, if passed as a parameter, you must just indicate the encrypted folder and the file name.
For example, you must use encrypted/resourceArchive-en-US.jet
as a parameter to use the file StreamingAssets/encrypted/resourceArchive-en-US.jet
.
public void setListener(FKCoreListener listener)
Sets the listener that will receive prediction results
Parameters | |
---|---|
FKCoreListener listener | The FKCoreListener instance that will receive prediction candidates |
public void NextWordPrediction(string context, int cursorStart, int cursorEnd)
Ask for the next word prediction in a context sentence at the specified cursor position
Parameters | |
---|---|
string context | The text context |
int cursorStart | The starting position of the cursor selection inside the context |
int cursorEnd | The ending position of the cursor selection inside the context |
public void CurrentWordPrediction(string context, int cursorStart, int cursorEnd)
Ask for the current word prediction (completions and auto-corretions) in a context sentence at the specified cursor position
Parameters | |
---|---|
string context | The text context |
int cursorStart | The starting position of the cursor selection inside the context |
int cursorEnd | The ending position of the cursor selection inside the context |
public void startSwipe()
Starts a swipe typing gesture
public void sendSwipeTypePoint(float x, float y)
Sends swipe point coordinates. It is important to note that we must pass the coordinates of the point in the coordinate space of the keyboard definition currently loaded by FKCoreXR. Remember that by default, it has a 320 x 288 keyboard loaded.
Parameters | |
---|---|
float x | The x coordinate of the swipe point |
float y | The y coordinate of the swipe point |
Stops a swipe typing gesture, starting the swipe decoding process
public void stopSwipe()