From f8bce500ff3f870e6eadae591541a1210e458cff Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 18 Apr 2021 00:55:31 +0200 Subject: Hide the input switching key if it's not needed Android has a new way of switching between input methods and this key need to be hidden in most cases. --- 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 000c7e0..c137af2 100644 --- a/srcs/juloo.keyboard2/KeyboardData.java +++ b/srcs/juloo.keyboard2/KeyboardData.java @@ -171,4 +171,16 @@ class KeyboardData return (k == null || (k.getFlags() & _flags) != 0) ? null : k; } } + + public static class RemoveKeysByEvent implements MapKeys + { + private final int _eventCode; + + public RemoveKeysByEvent(int ev) { _eventCode = ev; } + + public KeyValue map(KeyValue k) + { + return (k == null || k.getEventCode() == _eventCode) ? null : k; + } + } } -- cgit v1.2.3