diff options
| author | Jules Aguillon | 2022-09-24 22:36:06 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2022-09-24 22:36:06 +0200 |
| commit | 3081af5190b370409d858dc33f6dae00f84f2fd6 (patch) | |
| tree | 7af4c3ab642ba88cffff1f9f26b7d1bdbb098be0 /srcs/juloo.keyboard2/Autocapitalisation.java | |
| parent | c778b4e8a24896a779cb295fb59a22d9253a2bc5 (diff) | |
| download | unexpected-keyboard-3081af5190b370409d858dc33f6dae00f84f2fd6.tar.gz unexpected-keyboard-3081af5190b370409d858dc33f6dae00f84f2fd6.zip | |
Improve the auto capitalisation
- Detect when the input box is cleared
- Avoid looking up keys on the keyboard every time the shift state needs
to change.
Diffstat (limited to 'srcs/juloo.keyboard2/Autocapitalisation.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Autocapitalisation.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/srcs/juloo.keyboard2/Autocapitalisation.java b/srcs/juloo.keyboard2/Autocapitalisation.java index 1a339e0..2493771 100644 --- a/srcs/juloo.keyboard2/Autocapitalisation.java +++ b/srcs/juloo.keyboard2/Autocapitalisation.java @@ -108,6 +108,13 @@ final class Autocapitalisation { if (new_cursor == _cursor) // Just typing return; + if (new_cursor == 0) + { + // Detect whether the input box has been cleared + CharSequence t = _ic.getTextAfterCursor(1, 0); + if (t != null && t.equals("")) + _should_update_caps_mode = true; + } _cursor = new_cursor; _should_enable_shift = false; callback(true); |
