From 36e10a792ffd034ffb56e48e2e2282f6ae16cc8d Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 23 Oct 2022 21:34:05 +0200 Subject: Add the capslock key The key enable caps lock immediately. It does nothing if caps lock is already enabled. It is not present on the keyboard by default but a place is defined on every layout, top-right of the shift key. It can be enabled in the settings. The icon is from materialdesignicons.com. --- srcs/juloo.keyboard2/Keyboard2.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'srcs/juloo.keyboard2/Keyboard2.java') diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java index 12ee196..35d5b26 100644 --- a/srcs/juloo.keyboard2/Keyboard2.java +++ b/srcs/juloo.keyboard2/Keyboard2.java @@ -63,9 +63,9 @@ public class Keyboard2 extends InputMethodService public void update_shift_state(boolean should_enable, boolean should_disable) { if (should_enable) - _keyboardView.set_shift_state(true); + _keyboardView.set_shift_state(true, false); else if (should_disable) - _keyboardView.set_shift_state(false); + _keyboardView.set_shift_state(false, false); } private List getEnabledSubtypes(InputMethodManager imm) @@ -314,6 +314,11 @@ public class Keyboard2 extends InputMethodService conn.performEditorAction(_config.actionId); } + public void enableCapsLock() + { + _keyboardView.set_shift_state(true, true); + } + public void switchMain() { _keyboardView.setKeyboard(getLayout(_currentTextLayout)); -- cgit v1.2.3