From 4906f8105f9f831b5977d4935f90ef26b8afdafd Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 25 May 2024 21:19:44 +0200 Subject: Circle and round trip gestures (#640) This implements clockwise/anticlockwise circle and round trip gestures inspired by Messagease. The circle gestures start after a small threshold to avoid making the regular swipe too hard to aim. The gestures do: - circle: The center symbol with Shift applied, with a fallback on Fn - round trip: Same as the circle gesture but applied to a side symbol - anticlockwise circle: Nothing currently. It is intended to be made configurable per-layout in the future. The new Gesture class keeps track of what the pointer is doing while it moves on a key. It replaces the 'selected_direction' integer. --- srcs/juloo.keyboard2/KeyValue.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'srcs/juloo.keyboard2/KeyValue.java') diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java index 8435cae..e9e66cc 100644 --- a/srcs/juloo.keyboard2/KeyValue.java +++ b/srcs/juloo.keyboard2/KeyValue.java @@ -27,6 +27,7 @@ public final class KeyValue implements Comparable public static enum Modifier { SHIFT, + GESTURE, CTRL, ALT, META, @@ -54,8 +55,8 @@ public final class KeyValue implements Comparable ARROW_RIGHT, BREVE, BAR, - FN, // Must be placed last to be applied first - } + FN, + } // Last is be applied first public static enum Editing { @@ -404,6 +405,12 @@ public final class KeyValue implements Comparable return new KeyValue(str, Kind.String, 0, flags | FLAG_SMALLER_FONT); } + /** Make a modifier key for passing to [KeyModifier]. */ + public static KeyValue makeInternalModifier(Modifier mod) + { + return new KeyValue("", Kind.Modifier, mod.ordinal(), 0); + } + public static KeyValue getKeyByName(String name) { switch (name) -- cgit v1.2.3