From c5f2c0b727c0ef70a76e897402e0247f148553fc Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Fri, 26 Jan 2024 00:17:51 +0100 Subject: Send down event for modifiers on time This allows to use modifiers in combination with other inputs like a mouse click, for example under termux-x11. The key down event and notification about modifiers changing are sent down to KeyEventHandler. A mutable state remember for which modifier down events have been sent. When pressing down a modifier with one finger and typing with the other, it might appear that the modifier is released after the first time an other key is pressed and then pressed and released for the following keys. This prevents unintentionally type two modified keys instead of one when the second key is pressed while the other is not yet released. --- srcs/juloo.keyboard2/Config.java | 3 ++- 1 file changed, 2 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 e2fc316..b24210e 100644 --- a/srcs/juloo.keyboard2/Config.java +++ b/srcs/juloo.keyboard2/Config.java @@ -400,7 +400,8 @@ public final class Config public static interface IKeyEventHandler { public void key_down(KeyValue value, boolean is_swipe); - public void key_up(KeyValue value, Pointers.Modifiers flags); + public void key_up(KeyValue value, Pointers.Modifiers mods); + public void mods_changed(Pointers.Modifiers mods); } /** Config migrations. */ -- cgit v1.2.3