abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Autocapitalisation.java
diff options
context:
space:
mode:
authorJules Aguillon2025-02-23 12:12:29 +0100
committerGitHub2025-02-23 12:12:29 +0100
commit68be82a4f92f47300b9960cf9cf65040c96f17ed (patch)
treece79243fe3c1fff7b799af2040a7a76377e4ad5f /srcs/juloo.keyboard2/Autocapitalisation.java
parent581b31bf99bf7a4088ef12ea7e03fbc75d5acfed (diff)
downloadunexpected-keyboard-68be82a4f92f47300b9960cf9cf65040c96f17ed.tar.gz
unexpected-keyboard-68be82a4f92f47300b9960cf9cf65040c96f17ed.zip
Macro keys (#878)
Add "macro" keys that behave as if a sequence of keys is typed. Macro can be added to custom layouts or through the "Add keys to the keyboard option". The syntax is: symbol:key1,key2,.. The symbol cannot contain a : character. 'key1', 'key2', etc.. are: - 'String with \' escaping' The key will generate the specified string. - keyevent:123 The key will send a keyevent. - The name of any special key
Diffstat (limited to 'srcs/juloo.keyboard2/Autocapitalisation.java')
-rw-r--r--srcs/juloo.keyboard2/Autocapitalisation.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/srcs/juloo.keyboard2/Autocapitalisation.java b/srcs/juloo.keyboard2/Autocapitalisation.java
index bf28e9d..a77d2e5 100644
--- a/srcs/juloo.keyboard2/Autocapitalisation.java
+++ b/srcs/juloo.keyboard2/Autocapitalisation.java
@@ -88,6 +88,24 @@ public final class Autocapitalisation
callback_now(true);
}
+ /** Pause auto capitalisation until [unpause()] is called. */
+ public boolean pause()
+ {
+ boolean was_enabled = _enabled;
+ stop();
+ _enabled = false;
+ return was_enabled;
+ }
+
+ /** Continue auto capitalisation after [pause()] was called. Argument is the
+ output of [pause()]. */
+ public void unpause(boolean was_enabled)
+ {
+ _enabled = was_enabled;
+ _should_update_caps_mode = true;
+ callback_now(true);
+ }
+
public static interface Callback
{
public void update_shift_state(boolean should_enable, boolean should_disable);