diff options
| author | Jules Aguillon | 2025-08-16 18:48:00 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2025-12-28 18:08:12 +0100 |
| commit | f082fcdebc4f129cd262ee4a0a6b83d91fde72bb (patch) | |
| tree | 74dd1045f5e2584c56246b40bd9904a5eb865a8e /srcs/juloo.keyboard2/EditorConfig.java | |
| parent | 98c1b8db82c0da8f49eb12d18c9001a57009eca5 (diff) | |
| download | unexpected-keyboard-f082fcdebc4f129cd262ee4a0a6b83d91fde72bb.tar.gz unexpected-keyboard-f082fcdebc4f129cd262ee4a0a6b83d91fde72bb.zip | |
Track the currently typed word
The `CurrentlyTypedWord` class tracks the word that is being typed. It's
implemented on the same model as Autocapitalisation and avoid expensive
IPC calls when possible.
The `Suggestions` class is where the suggestion lookup should go. It
currently just echoes the current word.
Diffstat (limited to 'srcs/juloo.keyboard2/EditorConfig.java')
| -rw-r--r-- | srcs/juloo.keyboard2/EditorConfig.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/srcs/juloo.keyboard2/EditorConfig.java b/srcs/juloo.keyboard2/EditorConfig.java index d9f1ae9..bdfab3c 100644 --- a/srcs/juloo.keyboard2/EditorConfig.java +++ b/srcs/juloo.keyboard2/EditorConfig.java @@ -26,6 +26,11 @@ public final class EditorConfig // Whether caps state should be updated right away. public boolean caps_initially_updated = false; + /** CurrentlyTypedWord. */ + public CharSequence initial_text_before_cursor = null; + public int initial_sel_start; + public int initial_sel_end; + public EditorConfig() {} public void refresh(EditorInfo info, Resources res) @@ -66,6 +71,10 @@ public final class EditorConfig caps_mode = info.inputType & TextUtils.CAP_MODE_SENTENCES; caps_initially_enabled = (info.initialCapsMode != 0); caps_initially_updated = caps_should_update_state(info); + /* CurrentlyTypedWord */ + initial_text_before_cursor = info.getInitialTextBeforeCursor(10, 0); + initial_sel_start = info.initialSelStart; + initial_sel_end = info.initialSelEnd; } String actionLabel_of_imeAction(int action, Resources res) |
