abouttreesummaryrefslogcommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/xml/bone.xml4
-rw-r--r--res/xml/bottom_row.xml4
-rw-r--r--res/xml/neo2.xml4
-rw-r--r--res/xml/numeric.xml2
-rw-r--r--srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java17
5 files changed, 23 insertions, 8 deletions
diff --git a/res/xml/bone.xml b/res/xml/bone.xml
index 391c9f9..c107e88 100644
--- a/res/xml/bone.xml
+++ b/res/xml/bone.xml
@@ -36,8 +36,8 @@
<key width="1.5" key0="backspace" key1="delete" key3=";"/>
</row>
<row height="0.95">
- <key width="1.8" key0="ctrl" key2="meta" key4="switch_numeric"/>
- <key width="1.2" key0="fn" key1="alt" key2="change_method" key3="switch_emoji" key4="config"/>
+ <key width="1.8" key0="ctrl" key2="loc meta" key4="switch_numeric"/>
+ <key width="1.2" key0="fn" key1="loc alt" key2="change_method" key3="switch_emoji" key4="config"/>
<key width="4.0" key0="space" key1="switch_programming" key2="0" edgekeys="true"/>
<key width="1.2" key1="up" key2="right" key3="left" key4="down" edgekeys="true"/>
<key width="1.8" key0="enter" key3="action"/>
diff --git a/res/xml/bottom_row.xml b/res/xml/bottom_row.xml
index 14e28a2..bfd4e90 100644
--- a/res/xml/bottom_row.xml
+++ b/res/xml/bottom_row.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<row height="0.95">
- <key width="1.8" key0="ctrl" key1="loc switch_greekmath" key2="meta" key4="switch_numeric"/>
- <key width="1.2" key0="fn" key1="alt" key2="change_method" key3="switch_emoji" key4="config"/>
+ <key width="1.8" key0="ctrl" key1="loc switch_greekmath" key2="loc meta" key4="switch_numeric"/>
+ <key width="1.2" key0="fn" key1="loc alt" key2="change_method" key3="switch_emoji" key4="config"/>
<key width="4.0" key0="space" key1="switch_programming" edgekeys="true"/>
<key width="1.2" key1="up" key2="right" key3="left" key4="down" edgekeys="true"/>
<key width="1.8" key0="enter" key2="action"/>
diff --git a/res/xml/neo2.xml b/res/xml/neo2.xml
index f20c8b9..1ed75b8 100644
--- a/res/xml/neo2.xml
+++ b/res/xml/neo2.xml
@@ -39,8 +39,8 @@
<key width="1.5" key0="backspace" key2="delete"/>
</row>
<row height="0.95">
- <key width="1.8" key0="ctrl" key2="meta" key4="switch_numeric"/>
- <key width="1.2" key0="fn" key1="alt" key2="change_method" key3="switch_emoji" key4="config"/>
+ <key width="1.8" key0="ctrl" key2="loc meta" key4="switch_numeric"/>
+ <key width="1.2" key0="fn" key1="loc alt" key2="change_method" key3="switch_emoji" key4="config"/>
<key width="4.0" key0="space" key1="switch_programming" edgekeys="true"/>
<key width="1.2" key1="up" key2="right" key3="left" key4="down" edgekeys="true"/>
<key key0="j" key4=";"/>
diff --git a/res/xml/numeric.xml b/res/xml/numeric.xml
index 087b625..ba1081f 100644
--- a/res/xml/numeric.xml
+++ b/res/xml/numeric.xml
@@ -20,7 +20,7 @@
</row>
<row>
<key width="0.75" key0="switch_greekmath"/>
- <key width="0.75" key0="shift" key2="fn" key4="alt"/>
+ <key width="0.75" key0="shift" key2="fn" key4="loc alt"/>
<key key0="1" key1="superscript" key2="ordinal" key3="subscript"/>
<key key0="2"/>
<key key0="3"/>
diff --git a/srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java b/srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java
index 0a98b9d..d0734b9 100644
--- a/srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java
+++ b/srcs/juloo.keyboard2/ExtraKeyCheckBoxPreference.java
@@ -14,6 +14,8 @@ public class ExtraKeyCheckBoxPreference extends CheckBoxPreference
{
public static String[] extra_keys = new String[]
{
+ "alt",
+ "meta",
"accent_aigu",
"accent_grave",
"accent_double_aigu",
@@ -33,6 +35,18 @@ public class ExtraKeyCheckBoxPreference extends CheckBoxPreference
"switch_greekmath",
};
+ public static boolean default_checked(String name)
+ {
+ switch (name)
+ {
+ case "alt":
+ case "meta":
+ return true;
+ default:
+ return false;
+ }
+ }
+
boolean _key_font;
public ExtraKeyCheckBoxPreference(Context context, AttributeSet attrs)
@@ -43,6 +57,7 @@ public class ExtraKeyCheckBoxPreference extends CheckBoxPreference
a.recycle();
String key_name = extra_keys[index];
setKey(pref_key_of_key_name(key_name));
+ setDefaultValue(default_checked(key_name));
KeyValue kv = KeyValue.getKeyByName(key_name);
setTitle(kv.getString());
_key_font = kv.hasFlags(KeyValue.FLAG_KEY_FONT);
@@ -66,7 +81,7 @@ public class ExtraKeyCheckBoxPreference extends CheckBoxPreference
HashSet<KeyValue> ks = new HashSet<KeyValue>();
for (String key_name : extra_keys)
{
- if (prefs.getBoolean(pref_key_of_key_name(key_name), false))
+ if (prefs.getBoolean(pref_key_of_key_name(key_name), default_checked(key_name)))
ks.add(KeyValue.getKeyByName(key_name));
}
return ks;