From 68be82a4f92f47300b9960cf9cf65040c96f17ed Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 23 Feb 2025 12:12:29 +0100 Subject: 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 --- srcs/juloo.keyboard2/Autocapitalisation.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'srcs/juloo.keyboard2/Autocapitalisation.java') 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); -- cgit v1.2.3