From c7184303e9e291487641324468ec60417ef47bf7 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Mon, 30 Jan 2023 23:54:39 +0100 Subject: Remove the digits when numpad is visible --- srcs/juloo.keyboard2/Config.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'srcs/juloo.keyboard2/Config.java') diff --git a/srcs/juloo.keyboard2/Config.java b/srcs/juloo.keyboard2/Config.java index db570e1..5ff7951 100644 --- a/srcs/juloo.keyboard2/Config.java +++ b/srcs/juloo.keyboard2/Config.java @@ -172,11 +172,12 @@ final class Config // Extra keys are removed from the set as they are encountered during the // first iteration then automatically added. final Set extra_keys = new HashSet(); + final Set remove_keys = new HashSet(); if (extra_keys_subtype != null) extra_keys.addAll(extra_keys_subtype); extra_keys.addAll(extra_keys_param); if (show_numpad) - kw = kw.addNumPad(); + KeyboardData.num_pad.getKeys(remove_keys); kw = kw.mapKeys(new KeyboardData.MapKeyValues() { public KeyValue apply(KeyValue key, boolean localized) { @@ -185,6 +186,8 @@ final class Config extra_keys.remove(key); if (localized && !is_extra_key) return null; + if (remove_keys.contains(key)) + return null; switch (key.getKind()) { case Event: @@ -218,6 +221,8 @@ final class Config return key; } }); + if (show_numpad) + kw = kw.addNumPad(); if (extra_keys.size() > 0) kw = kw.addExtraKeys(extra_keys.iterator()); return kw; -- cgit v1.2.3