From 408d80b26ca49bd96f47a73741c5cb0a0e27b9d6 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 17 Feb 2024 12:04:02 +0100 Subject: [PATCH] Remove the old implementation of the Caps lock button --- srcs/juloo.keyboard2/KeyEventHandler.java | 6 +++--- srcs/juloo.keyboard2/KeyValue.java | 1 - srcs/juloo.keyboard2/Keyboard2.java | 8 ++------ srcs/juloo.keyboard2/Keyboard2View.java | 6 +++--- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/srcs/juloo.keyboard2/KeyEventHandler.java b/srcs/juloo.keyboard2/KeyEventHandler.java index 65de779..db2f32e 100644 --- a/srcs/juloo.keyboard2/KeyEventHandler.java +++ b/srcs/juloo.keyboard2/KeyEventHandler.java @@ -292,7 +292,7 @@ public final class KeyEventHandler implements Config.IKeyEventHandler public static interface IReceiver { public void handle_event_key(KeyValue.Event ev); - public void set_shift_state(boolean state, boolean lock); + public void set_shift_state(boolean state); public InputConnection getCurrentInputConnection(); } @@ -302,9 +302,9 @@ public final class KeyEventHandler implements Config.IKeyEventHandler public void update_shift_state(boolean should_enable, boolean should_disable) { if (should_enable) - _recv.set_shift_state(true, false); + _recv.set_shift_state(true); else if (should_disable) - _recv.set_shift_state(false, false); + _recv.set_shift_state(false); } } } diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java index 2503fe5..052948d 100644 --- a/srcs/juloo.keyboard2/KeyValue.java +++ b/srcs/juloo.keyboard2/KeyValue.java @@ -18,7 +18,6 @@ public final class KeyValue SWITCH_FORWARD, SWITCH_BACKWARD, SWITCH_GREEKMATH, - CAPS_LOCK, SWITCH_VOICE_TYPING, SWITCH_VOICE_TYPING_CHOOSER, } diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java index 2a6025b..b042eba 100644 --- a/srcs/juloo.keyboard2/Keyboard2.java +++ b/srcs/juloo.keyboard2/Keyboard2.java @@ -418,10 +418,6 @@ public class Keyboard2 extends InputMethodService setSpecialLayout(loadNumpad(R.xml.greekmath)); break; - case CAPS_LOCK: - set_shift_state(true, true); - break; - case SWITCH_VOICE_TYPING: if (!VoiceImeSwitcher.switch_to_voice_ime(Keyboard2.this, get_imm(), Config.globalPrefs())) @@ -435,9 +431,9 @@ public class Keyboard2 extends InputMethodService } } - public void set_shift_state(boolean state, boolean lock) + public void set_shift_state(boolean state) { - _keyboardView.set_shift_state(state, lock); + _keyboardView.set_shift_state(state); } public InputConnection getCurrentInputConnection() diff --git a/srcs/juloo.keyboard2/Keyboard2View.java b/srcs/juloo.keyboard2/Keyboard2View.java index fb95412..8aac9e3 100644 --- a/srcs/juloo.keyboard2/Keyboard2View.java +++ b/srcs/juloo.keyboard2/Keyboard2View.java @@ -110,16 +110,16 @@ public class Keyboard2View extends View } /** Called by auto-capitalisation. */ - public void set_shift_state(boolean state, boolean lock) + public void set_shift_state(boolean state) { if (_keyboard == null || _shift_key == null) return; int flags = _pointers.getKeyFlags(_shift_key, _shift_kv); if (state) { - if (flags != -1 && !lock) + if (flags != -1) return; // Don't replace an existing pointer - _pointers.add_fake_pointer(_shift_kv, _shift_key, lock); + _pointers.add_fake_pointer(_shift_kv, _shift_key, false); } else {