Use the improved font for shift, globe, enter and space

These glyph were available in the custom font but not used yet.
This commit is contained in:
Jules Aguillon 2022-02-13 13:46:37 +01:00
parent b488c766b1
commit fda6895dc8

View File

@ -126,7 +126,12 @@ class KeyValue
private static void addSpecialKey(String name, String symbol, int event) 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) private static void addEventKey(String name, String symbol, int event)
@ -145,7 +150,7 @@ class KeyValue
for (int i = 0; i < chars.length(); i++) for (int i = 0; i < chars.length(); i++)
addCharKey(chars.charAt(i), EVENT_NONE); 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("ctrl", "Ctrl", FLAG_CTRL);
addModifierKey("alt", "Alt", FLAG_ALT); addModifierKey("alt", "Alt", FLAG_ALT);
addModifierKey("accent_aigu", "◌́", FLAG_ACCENT2); addModifierKey("accent_aigu", "◌́", FLAG_ACCENT2);
@ -222,11 +227,12 @@ class KeyValue
addSpecialKey("switch_numeric", "123+", EVENT_SWITCH_NUMERIC); addSpecialKey("switch_numeric", "123+", EVENT_SWITCH_NUMERIC);
addSpecialKey("switch_emoji", "", EVENT_SWITCH_EMOJI); addSpecialKey("switch_emoji", "", EVENT_SWITCH_EMOJI);
addSpecialKey("switch_back_emoji", "ABC", EVENT_SWITCH_BACK_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 addSpecialKey("action", "Action", EVENT_ACTION); // Will always be replaced
addEventKey("esc", "Esc", KeyEvent.KEYCODE_ESCAPE); 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("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("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); addEventKey("down", "\uE809", KeyEvent.KEYCODE_DPAD_DOWN, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT);
@ -251,6 +257,6 @@ class KeyValue
addEventKey("tab", "", KeyEvent.KEYCODE_TAB); addEventKey("tab", "", KeyEvent.KEYCODE_TAB);
addKey("\\t", "\\t", '\t', EVENT_NONE, 0); // Send the tab character 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);
} }
} }