From f56b9268578addff02d7feeb905d961b170dc860 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 16 Oct 2022 22:34:21 +0200 Subject: [PATCH] Autocapitalisation: Avoid trigerring when Ctrl+Del Autocapitalisation could trigger while repeatedly typing Ctrl+Del to remove several words. --- srcs/juloo.keyboard2/Autocapitalisation.java | 8 +++++++- srcs/juloo.keyboard2/Keyboard2.java | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/srcs/juloo.keyboard2/Autocapitalisation.java b/srcs/juloo.keyboard2/Autocapitalisation.java index db97ec3..6249d10 100644 --- a/srcs/juloo.keyboard2/Autocapitalisation.java +++ b/srcs/juloo.keyboard2/Autocapitalisation.java @@ -65,8 +65,14 @@ final class Autocapitalisation callback(false); } - public void event_sent(int code) + public void event_sent(int code, int meta) { + if (meta != 0) + { + _should_enable_shift = false; + _should_update_caps_mode = false; + return; + } switch (code) { case KeyEvent.KEYCODE_DEL: diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java index c05f231..12ee196 100644 --- a/srcs/juloo.keyboard2/Keyboard2.java +++ b/srcs/juloo.keyboard2/Keyboard2.java @@ -353,7 +353,7 @@ public class Keyboard2 extends InputMethodService return; conn.sendKeyEvent(new KeyEvent(1, 1, eventAction, eventCode, 0, meta)); if (eventAction == KeyEvent.ACTION_UP) - _autocap.event_sent(eventCode); + _autocap.event_sent(eventCode, meta); } public void showKeyboardConfig()