From fda6895dc8a5b2dd7a10dccc68250ba2d5678a07 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 13 Feb 2022 13:46:37 +0100 Subject: [PATCH] Use the improved font for shift, globe, enter and space These glyph were available in the custom font but not used yet. --- srcs/juloo.keyboard2/KeyValue.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java index e8c8300..67a6405 100644 --- a/srcs/juloo.keyboard2/KeyValue.java +++ b/srcs/juloo.keyboard2/KeyValue.java @@ -126,7 +126,12 @@ class KeyValue private static void addSpecialKey(String name, String symbol, int event) { - addKey(name, symbol, CHAR_NONE, event, FLAG_NOREPEAT); + addSpecialKey(name, symbol, event, 0); + } + + private static void addSpecialKey(String name, String symbol, int event, int flags) + { + addKey(name, symbol, CHAR_NONE, event, flags | FLAG_NOREPEAT); } private static void addEventKey(String name, String symbol, int event) @@ -145,7 +150,7 @@ class KeyValue for (int i = 0; i < chars.length(); i++) addCharKey(chars.charAt(i), EVENT_NONE); - addModifierKey("shift", "⇧", FLAG_LOCK | FLAG_SHIFT); + addModifierKey("shift", "\uE808", FLAG_LOCK | FLAG_SHIFT | FLAG_KEY_FONT); addModifierKey("ctrl", "Ctrl", FLAG_CTRL); addModifierKey("alt", "Alt", FLAG_ALT); addModifierKey("accent_aigu", "◌́", FLAG_ACCENT2); @@ -222,11 +227,12 @@ class KeyValue addSpecialKey("switch_numeric", "123+", EVENT_SWITCH_NUMERIC); addSpecialKey("switch_emoji", "☻", EVENT_SWITCH_EMOJI); addSpecialKey("switch_back_emoji", "ABC", EVENT_SWITCH_BACK_EMOJI); - addSpecialKey("change_method", "⊞", EVENT_CHANGE_METHOD); + addSpecialKey("change_method", "\ue807", EVENT_CHANGE_METHOD, FLAG_KEY_FONT); addSpecialKey("action", "Action", EVENT_ACTION); // Will always be replaced addEventKey("esc", "Esc", KeyEvent.KEYCODE_ESCAPE); - addEventKey("enter", "\u23CE", KeyEvent.KEYCODE_ENTER, FLAG_KEY_FONT); + // Enter should be '\u23CE' but using what is in the font file at the moment + addEventKey("enter", "\ue800", KeyEvent.KEYCODE_ENTER, FLAG_KEY_FONT); addEventKey("up", "\uE80B", KeyEvent.KEYCODE_DPAD_UP, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT); addEventKey("right", "\uE80C", KeyEvent.KEYCODE_DPAD_RIGHT, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT); addEventKey("down", "\uE809", KeyEvent.KEYCODE_DPAD_DOWN, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT); @@ -251,6 +257,6 @@ class KeyValue addEventKey("tab", "↹", KeyEvent.KEYCODE_TAB); addKey("\\t", "\\t", '\t', EVENT_NONE, 0); // Send the tab character - addKey("space", " ", ' ', KeyEvent.KEYCODE_SPACE, 0); + addKey("space", "\ue80d", ' ', KeyEvent.KEYCODE_SPACE, FLAG_KEY_FONT); } }