From e872c5878874bdd035b9ca870853068a53cfc002 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 19 Mar 2022 15:39:20 +0100 Subject: Allow modifiers to hide keys Modifiers can temporarily remove a key from the layout by returning 'null'. Make sure pointer handling code handle these modified keys gracefully and doesn't trigger a key event and a vibration for the removed key. --- srcs/juloo.keyboard2/KeyboardData.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'srcs/juloo.keyboard2/KeyboardData.java') diff --git a/srcs/juloo.keyboard2/KeyboardData.java b/srcs/juloo.keyboard2/KeyboardData.java index 81b6870..f0b1d1b 100644 --- a/srcs/juloo.keyboard2/KeyboardData.java +++ b/srcs/juloo.keyboard2/KeyboardData.java @@ -194,6 +194,18 @@ class KeyboardData { return new Key(key0, key1, key2, key3, key4, width * s, shift, edgekeys); } + + public KeyValue getValue(int index) + { + switch (index) + { + case 1: return key1; + case 2: return key2; + case 3: return key3; + case 4: return key4; + default: case 0: return key0; + } + } } public static abstract interface MapKeys extends Function { } -- cgit v1.2.3