abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Keyboard2.java
diff options
context:
space:
mode:
authorJules Aguillon2022-10-23 21:34:05 +0200
committerJules Aguillon2022-10-23 21:37:04 +0200
commit36e10a792ffd034ffb56e48e2e2282f6ae16cc8d (patch)
treeaf8b28705250fd8a1a685d0bc79c759cd5b66059 /srcs/juloo.keyboard2/Keyboard2.java
parent55cece796588ad58646d9ea877912510af06e24e (diff)
downloadunexpected-keyboard-36e10a792ffd034ffb56e48e2e2282f6ae16cc8d.tar.gz
unexpected-keyboard-36e10a792ffd034ffb56e48e2e2282f6ae16cc8d.zip
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.
Diffstat (limited to 'srcs/juloo.keyboard2/Keyboard2.java')
-rw-r--r--srcs/juloo.keyboard2/Keyboard2.java9
1 files changed, 7 insertions, 2 deletions
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<InputMethodSubtype> 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));