abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Config.java
diff options
context:
space:
mode:
authorJules Aguillon2023-02-12 23:20:11 +0100
committerJules Aguillon2023-02-12 23:20:11 +0100
commit0f62b3044c501dc5679583e06447285ebeb31118 (patch)
treecb3cd47834c464cf8884627fe1e350be03fb6b05 /srcs/juloo.keyboard2/Config.java
parentc46e3b6c619b6af5825161d4960ea4829a44d429 (diff)
downloadunexpected-keyboard-0f62b3044c501dc5679583e06447285ebeb31118.tar.gz
unexpected-keyboard-0f62b3044c501dc5679583e06447285ebeb31118.zip
Option to switch to the previous input method
A new option changes the "change_method" into the new "change_method_prev". It switch to the previously used input method. A long press on "change_method_prev" sends "change_method". A new section is added in the settings and existing options are moved.
Diffstat (limited to 'srcs/juloo.keyboard2/Config.java')
-rw-r--r--srcs/juloo.keyboard2/Config.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java
index eda2740..586db4e 100644
--- a/srcs/juloo.keyboard2/Config.java
+++ b/srcs/juloo.keyboard2/Config.java
@@ -48,6 +48,7 @@ final class Config
public int accents; // Values are R.values.pref_accents_v_*
public int theme; // Values are R.style.*
public boolean autocapitalisation;
+ public boolean switch_input_immediate;
// Dynamically set
public boolean shouldOfferSwitchingToNextInputMethod;
@@ -152,6 +153,7 @@ final class Config
accents = Integer.valueOf(_prefs.getString("accents", "1"));
theme = getThemeId(res, _prefs.getString("theme", ""));
autocapitalisation = _prefs.getBoolean("autocapitalisation", true);
+ switch_input_immediate = _prefs.getBoolean("switch_input_immediate", false);
extra_keys_param = ExtraKeyCheckBoxPreference.get_extra_keys(_prefs);
}
@@ -200,7 +202,11 @@ final class Config
switch (key.getEvent())
{
case CHANGE_METHOD:
- return shouldOfferSwitchingToNextInputMethod ? key : null;
+ if (!shouldOfferSwitchingToNextInputMethod)
+ return null;
+ if (switch_input_immediate)
+ return KeyValue.getKeyByName("change_method_prev");
+ return key;
case ACTION:
return (swapEnterActionKey && action_key != null) ?
KeyValue.getKeyByName("enter") : action_key;