- About XR
- XR Unity SDK
- XR SDK Release Notes
- Version:1.0.3
- Version:1.0.2
- Version:1.0.1
- Version:1.0.0
- Version:0.9.59
- Version:0.9.58
- Version:0.9.57
- Version:0.9.56
- Version:0.9.55
- Version:0.9.54
- Version:0.9.53
- Version:0.9.52
- Version:0.9.51
- Version:0.9.38
- Version:0.9.37
- Version:0.9.34
- Version:0.9.33
- Version:0.9.32
- Version:0.9.31
- Version:0.9.30
- Version:0.9.24
- Version:0.9.23 Beta
Sample - IME¶
Contents
Introduction¶
In this sample, we will introduce how to use IME by general and customized.
Developer can change the keyboard style by change components color.
General IME¶
If developer have the key-in requirements, you can pull the IME component to the scene, and not need do other things, the user can use IME keyboard direct.
Customized IME¶
If developer want to create their own keyboard, they must implement two class as below:
XRIMEjni
XRIMEInputfieldCursorAgent
APIs are provided here to trigger native function, the following is a summary of the function.
For Text Change
XRIMEjni - imsCommitTextEvent
XRIMEjni - imsSetComposingRegionEvent
XRIMEjni - imsSetComposingTextEvent
XRIMEjni - imsDeleteTextEvent
For Keyboard Action
For Suggestion Change
XRIMEEventSystem - TriggerReplaceKey
XRIMEEventSystem - OnUpdateSuggestionString
For key-in alphabet, use TriggerReplaceKey to send “A” to native, it will invoke OnUpdateSuggestionString and callback “Apple” to OnReturnSuggestion for update suggestion lable.
XRIMEEventSystem - TriggerReplaceKey
XRIMEEventSystem - OnReplaceKeyTrigger
For click suggestion button, use TriggerReplaceKey to set word content and lenth, it will invoke OnReplaceKeyTrigger.
XRIMEEventSystem - ApplySuggestion
XRIMEEventSystem - OnApplySuggestion
For next suggestion, use ApplySuggestion to send “Apple” to native, it will invoke OnApplySuggestion and callback “is” to OnReturnSuggestion for update suggestion lable.
Note
More detail description, please vivst API - XRIMERemote, API - XRIMEEventSystem and API - XRIMEJni.