diff options
| author | Jules Aguillon | 2023-01-30 23:54:39 +0100 |
|---|---|---|
| committer | Jules Aguillon | 2023-01-30 23:54:39 +0100 |
| commit | c7184303e9e291487641324468ec60417ef47bf7 (patch) | |
| tree | 2443ab52e468671f8ae57f5dddb0e2ed13c68461 /srcs/juloo.keyboard2/Config.java | |
| parent | 78a461f7406a5ac76b686c646e8229fc8bb2a0d0 (diff) | |
| download | unexpected-keyboard-c7184303e9e291487641324468ec60417ef47bf7.tar.gz unexpected-keyboard-c7184303e9e291487641324468ec60417ef47bf7.zip | |
Remove the digits when numpad is visible
Diffstat (limited to 'srcs/juloo.keyboard2/Config.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Config.java | 7 |
1 files changed, 6 insertions, 1 deletions
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<KeyValue> extra_keys = new HashSet<KeyValue>(); + final Set<KeyValue> remove_keys = new HashSet<KeyValue>(); 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; |
