From f082fcdebc4f129cd262ee4a0a6b83d91fde72bb Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 16 Aug 2025 18:48:00 +0200 Subject: 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. --- srcs/juloo.keyboard2/Keyboard2.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'srcs/juloo.keyboard2/Keyboard2.java') diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java index c7d7e3d..a2940d5 100644 --- a/srcs/juloo.keyboard2/Keyboard2.java +++ b/srcs/juloo.keyboard2/Keyboard2.java @@ -346,7 +346,7 @@ public class Keyboard2 extends InputMethodService public void onUpdateSelection(int oldSelStart, int oldSelEnd, int newSelStart, int newSelEnd, int candidatesStart, int candidatesEnd) { super.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd, candidatesStart, candidatesEnd); - _keyeventhandler.selection_updated(oldSelStart, newSelStart); + _keyeventhandler.selection_updated(oldSelStart, newSelStart, newSelEnd); if ((oldSelStart == oldSelEnd) != (newSelStart == newSelEnd)) _keyboardView.set_selection_state(newSelStart != newSelEnd); } @@ -481,6 +481,11 @@ public class Keyboard2 extends InputMethodService { return _handler; } + + public void set_suggestions(List suggestions) + { + _candidates_view.set_candidates(suggestions); + } } private IBinder getConnectionToken() -- cgit v1.2.3