abouttreesummaryrefslogcommitdiff
diff options
context:
space:
mode:
authorJules Aguillon2022-03-06 19:36:09 +0100
committerJules Aguillon2022-03-06 19:36:09 +0100
commit534e4cb84323edfcc7bab969548b1baeba0018ee (patch)
tree74a816b7620753cd4aa472163be7889097ecac02
parente303008e666c129caf886ea27ab840e2cc2322c5 (diff)
downloadunexpected-keyboard-534e4cb84323edfcc7bab969548b1baeba0018ee.tar.gz
unexpected-keyboard-534e4cb84323edfcc7bab969548b1baeba0018ee.zip
Make the font smaller for the action key
-rw-r--r--srcs/juloo.keyboard2/Config.java4
-rw-r--r--srcs/juloo.keyboard2/KeyValue.java7
2 files changed, 8 insertions, 3 deletions
diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java
index cd9629a..0af2de9 100644
--- a/srcs/juloo.keyboard2/Config.java
+++ b/srcs/juloo.keyboard2/Config.java
@@ -134,9 +134,9 @@ final class Config
*/
public KeyboardData modify_layout(KeyboardData kw)
{
+ // Update the name to avoid caching in KeyModifier
KeyValue action_key = (actionLabel == null) ? null :
- new KeyValue(actionLabel, actionLabel, KeyValue.CHAR_NONE,
- KeyValue.EVENT_ACTION, KeyValue.FLAG_NOREPEAT);
+ KeyValue.getKeyByName("action").withNameAndSymbol(actionLabel, actionLabel);
return kw.replaceKeys(key -> {
if (key == null)
return null;
diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java
index dd42f42..484e825 100644
--- a/srcs/juloo.keyboard2/KeyValue.java
+++ b/srcs/juloo.keyboard2/KeyValue.java
@@ -87,6 +87,11 @@ class KeyValue
return new KeyValue(name, s, c, eventCode, flags);
}
+ public KeyValue withNameAndSymbol(String n, String s)
+ {
+ return new KeyValue(n, s, char_, eventCode, flags);
+ }
+
public KeyValue withFlags(int f)
{
return new KeyValue(name, symbol, char_, eventCode, f);
@@ -240,7 +245,7 @@ class KeyValue
addSpecialKey("switch_emoji", "\uE812" , EVENT_SWITCH_EMOJI, FLAG_KEY_FONT | FLAG_SMALLER_FONT);
addSpecialKey("switch_back_emoji", "ABC", EVENT_SWITCH_BACK_EMOJI);
addSpecialKey("change_method", "\ue807", EVENT_CHANGE_METHOD, FLAG_KEY_FONT | FLAG_SMALLER_FONT);
- addSpecialKey("action", "Action", EVENT_ACTION); // Will always be replaced
+ addSpecialKey("action", "Action", EVENT_ACTION, FLAG_SMALLER_FONT); // Will always be replaced
addEventKey("esc", "Esc", KeyEvent.KEYCODE_ESCAPE, FLAG_SMALLER_FONT);
addEventKey("enter", "\ue800", KeyEvent.KEYCODE_ENTER, FLAG_KEY_FONT);