abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Config.java
diff options
context:
space:
mode:
authorJules Aguillon2026-01-30 21:18:48 +0100
committerGitHub2026-01-30 21:18:48 +0100
commit1b8506876a1d8cff876220a7b6610b7bbe9e8841 (patch)
tree4881a8e8fd4276a823c57869000308d1bc5ba66f /srcs/juloo.keyboard2/Config.java
parente05be0821ba507dd5ea661bdde0af8a14e6fcbd6 (diff)
downloadunexpected-keyboard-1b8506876a1d8cff876220a7b6610b7bbe9e8841.tar.gz
unexpected-keyboard-1b8506876a1d8cff876220a7b6610b7bbe9e8841.zip
Option to switch to the previously used keyboard (#1165)
The "Switch to the last used keyboard" is renamed to "Switching between input methods" and allows to select "Switch to last used", which was the default in older releases.
Diffstat (limited to 'srcs/juloo.keyboard2/Config.java')
-rw-r--r--srcs/juloo.keyboard2/Config.java21
1 files changed, 18 insertions, 3 deletions
diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java
index 775c206..5719bd9 100644
--- a/srcs/juloo.keyboard2/Config.java
+++ b/srcs/juloo.keyboard2/Config.java
@@ -65,7 +65,7 @@ public final class Config
public float characterSize; // Ratio
public int theme; // Values are R.style.*
public boolean autocapitalisation;
- public boolean switch_input_immediate;
+ public KeyValue change_method_key_replacement;
public NumberLayout selected_number_layout;
public boolean borderConfig;
public int circle_sensitivity;
@@ -173,7 +173,7 @@ public final class Config
* characterSizeScale;
theme = getThemeId(res, _prefs.getString("theme", ""));
autocapitalisation = _prefs.getBoolean("autocapitalisation", true);
- switch_input_immediate = _prefs.getBoolean("switch_input_immediate", false);
+ change_method_key_replacement = get_change_method_key_replacement(_prefs);
extra_keys_param = ExtraKeysPreference.get_extra_keys(_prefs);
extra_keys_custom = CustomExtraKeysPreference.get(_prefs);
selected_number_layout = NumberLayout.of_string(_prefs.getString("number_entry_layout", "pin"));
@@ -268,6 +268,17 @@ public final class Config
}
}
+ private static KeyValue get_change_method_key_replacement(SharedPreferences prefs)
+ {
+ switch (prefs.getString("change_method_key_replacement", "prev"))
+ {
+ case "prev": return KeyValue.getKeyByName("change_method_prev");
+ case "next": return KeyValue.getKeyByName("change_method_next");
+ default:
+ case "picker": return KeyValue.getKeyByName("change_method");
+ }
+ }
+
private static Config _globalConfig = null;
public static void initGlobalConfig(SharedPreferences prefs, Resources res,
@@ -298,7 +309,7 @@ public final class Config
/** Config migrations. */
- private static int CONFIG_VERSION = 3;
+ private static int CONFIG_VERSION = 4;
public static void migrate(SharedPreferences prefs)
{
@@ -335,6 +346,10 @@ public final class Config
}
// Fallthrough
case 3:
+ e.putString("change_method_key_replacement",
+ prefs.getBoolean("switch_input_immediate", false) ? "prev" : "picker");
+ // Fallthrough
+ case 4:
default: break;
}
e.apply();