From cd3f3a03a997bc9c3353e5e806b4b231ea4cb11a Mon Sep 17 00:00:00 2001 From: Guido Bartolucci Date: Mon, 29 Jul 2019 08:58:53 -0400 Subject: [PATCH] Proof on concept to display unicode via the UC macro --- src/components/BaseKey.vue | 3 ++- src/jquery.js | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/BaseKey.vue b/src/components/BaseKey.vue index 0a542f4736..eff8789a03 100644 --- a/src/components/BaseKey.vue +++ b/src/components/BaseKey.vue @@ -220,7 +220,8 @@ export default { ); }, formatName(name) { - return name.length === 1 ? name.toUpperCase() : name; + let unicode = name.codePointAt(0) > 255; + return name.length === 1 && !unicode ? name.toUpperCase() : name; }, remove() { this.setSelected(this.id); diff --git a/src/jquery.js b/src/jquery.js index 9b372ee579..d0b905b565 100644 --- a/src/jquery.js +++ b/src/jquery.js @@ -264,6 +264,11 @@ function parseKeycode(keycode, stats) { let internal = splitcode[1]; internal = internal.split(')')[0]; + if (maincode === 'UC') { + metadata = {code: keycode, name: String.fromCodePoint(internal), title: `Unicode ${internal}`} + return newKey(metadata, keycode) + } + //Check whether it is a layer switching code or combo keycode if (internal.includes('KC')) { // Layer Tap keycode