From d3753cc455b22bdaf7e687632f2ae089409e2bdb Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 8 Feb 2025 23:16:18 +0100 Subject: [PATCH] Add a glyph for cancelling the compose key --- assets/special_font.ttf | Bin 20764 -> 20868 bytes srcs/juloo.keyboard2/ComposeKey.java | 2 +- srcs/juloo.keyboard2/KeyValue.java | 13 +++++-------- srcs/special_font/01A.svg | 9 +++++++++ 4 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 srcs/special_font/01A.svg diff --git a/assets/special_font.ttf b/assets/special_font.ttf index 4f6c23dc0745a5e7c9f8e8fa84552bb863705840..c21ad2977549c297a76c1beb0c54a1ef005821af 100644 GIT binary patch delta 544 zcmbQUh_Pic;{=6z;{=Nn3=GUB3=B+0$z>%942n#Z3=FIp3=9k`>50V!|Nk>EGcW|! z0Qns0IhAQM3yoJWFt7pDySikgCZ;q-zyAl6I|IaK89)K{hs;2EMiwAnB_p?_f>%fq z$YcbGb>-wICtfmnyb5T34p8t!ZeoRH0mF8N^*~7tpnyVNVs2_erJ^4LgLehcL6Qae z#UHg`IJ7JgY-J3!4dB zAKNK*2lgoTIqb*SKXAx#bZ~s*%;UVn<-@gw+lYG&j|9&YoKym$E4@XPV{@qZC0 z5O^UNCAdvUOsGNVfv}D6G!YJwGLb8yZlVjs*u-+gu8CWTPZED45hHO-(oAxZl$cbB z)Fo*L>3PzBWXfc|$u`OUkxP(!A@9W}e@wwaVV$Cq;v6M2rA3={*fw&9voN>=Lt;Kt z1kelI48jcJzyMGdG*&S&GZGVFQ(_VkGcq$#Q{rc2G-vEFGWz#+(uGNrE*#nLW5b3Y zttw1vDopl&Z>N85kH@fP9sV+>#0| zU5TAQ{t6&&%gIkpyfxvZ6VUt=p!~7i#0tv-hHVV%fsz_P0foH8+|-0hMLz}xZwa7- zBn$G3ON39XT+6`VYXWrSJqAXgDj;6=V>!#j8~*HxV1cB`dW^3&%P?s(N@@We3sNJ) zz{1D}qy>Nw===wglM|SYxg8h+7|IxCF|1+OH+dfO!Oe**Y>bmLS?%gM*pk@hv5TdZM5RPaL~n^Xh^-Rm6HgOAAYmXeOOi{nO!AeKhtx7@5$Pi7 z3o>3Zr)0xqFUXn5?U9$0pT(yjqR^!9O|d|UOR0>3VY3O_M()kFLKW7GNt3tv9+_O@ ScW!f#zb+Fy(DT6fU;+Stt8-ZZ diff --git a/srcs/juloo.keyboard2/ComposeKey.java b/srcs/juloo.keyboard2/ComposeKey.java index 6e0094d..f2169b1 100644 --- a/srcs/juloo.keyboard2/ComposeKey.java +++ b/srcs/juloo.keyboard2/ComposeKey.java @@ -17,7 +17,7 @@ public final class ComposeKey return res; /* Tapping compose again exits the pending sequence. */ case Compose_pending: - return KeyValue.nothingKey(kv); + return KeyValue.getKeyByName("compose_cancel"); /* These keys are not greyed. */ case Event: case Modifier: diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java index 91cf634..1c2f10f 100644 --- a/srcs/juloo.keyboard2/KeyValue.java +++ b/srcs/juloo.keyboard2/KeyValue.java @@ -80,7 +80,7 @@ public final class KeyValue implements Comparable public static enum Placeholder { REMOVED, - NOTHING, + COMPOSE_CANCEL, F11, F12, SHINDOT, @@ -381,14 +381,10 @@ public final class KeyValue implements Comparable return new KeyValue("", Kind.Placeholder, id.ordinal(), 0); } - /** Make a key that does nothing, inheriting the symbol from an other key. */ - public static KeyValue nothingKey(KeyValue inherit) + private static KeyValue placeholderKey(int symbol, Placeholder id, int flags) { - // Keep only appearance flags - int flags = inherit.getFlags() & (FLAG_SPECIAL | FLAG_GREYED | - FLAG_KEY_FONT | FLAG_SMALLER_FONT | FLAG_SECONDARY); - return new KeyValue(inherit.getString(), Kind.Placeholder, - Placeholder.NOTHING.ordinal(), flags); + return new KeyValue(String.valueOf((char)symbol), Kind.Placeholder, + id.ordinal(), flags | FLAG_KEY_FONT); } public static KeyValue makeStringKey(String str) @@ -698,6 +694,7 @@ public final class KeyValue implements Comparable /* The compose key */ case "compose": return makeComposePending(0xE016, ComposeKeyData.compose, FLAG_SECONDARY | FLAG_SPECIAL); + case "compose_cancel": return placeholderKey(0xE01A, Placeholder.COMPOSE_CANCEL, FLAG_SECONDARY | FLAG_SPECIAL); /* Placeholder keys */ case "removed": return placeholderKey(Placeholder.REMOVED); diff --git a/srcs/special_font/01A.svg b/srcs/special_font/01A.svg new file mode 100644 index 0000000..98262a6 --- /dev/null +++ b/srcs/special_font/01A.svg @@ -0,0 +1,9 @@ + + + + + + + + +