From ff0c0354d6395f58da6d7c4d4b5b724fa054e38f Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 23 Oct 2022 21:51:43 +0200 Subject: Show keys description in settings The symbols alone might be hard to understand when scrolling through the "extra keys" option. --- srcs/juloo.keyboard2/KeyValue.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'srcs/juloo.keyboard2/KeyValue.java') diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java index d6e1ce8..0587278 100644 --- a/srcs/juloo.keyboard2/KeyValue.java +++ b/srcs/juloo.keyboard2/KeyValue.java @@ -342,6 +342,25 @@ final class KeyValue addPlaceholderKey("f12_placeholder"); } + static final HashMap keys_descr = new HashMap(); + + /* Some keys have a description attached. Return [null] if otherwise. */ + public static String getKeyDescription(String name) + { + return keys_descr.get(name); + } + + static void addKeyDescr(String name, String descr) + { + keys_descr.put(name, descr); + } + + static { + /* Keys description is shown in the settings. */ + addKeyDescr("capslock", "Caps lock"); + addKeyDescr("switch_greekmath", "Greek & math symbols"); + } + // Substitute for [assert], which has no effect on Android. private static void check(boolean b) { -- cgit v1.2.3