abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/KeyValue.java
diff options
context:
space:
mode:
authorJules Aguillon2024-05-25 21:19:44 +0200
committerGitHub2024-05-25 21:19:44 +0200
commit4906f8105f9f831b5977d4935f90ef26b8afdafd (patch)
treefbcc7e4aef2493dbe892f134c8b3bd7124ad2880 /srcs/juloo.keyboard2/KeyValue.java
parent96fc4003f1f1705473398880f2bc2e5c2757c471 (diff)
downloadunexpected-keyboard-4906f8105f9f831b5977d4935f90ef26b8afdafd.tar.gz
unexpected-keyboard-4906f8105f9f831b5977d4935f90ef26b8afdafd.zip
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.
Diffstat (limited to 'srcs/juloo.keyboard2/KeyValue.java')
-rw-r--r--srcs/juloo.keyboard2/KeyValue.java11
1 files changed, 9 insertions, 2 deletions
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<KeyValue>
public static enum Modifier
{
SHIFT,
+ GESTURE,
CTRL,
ALT,
META,
@@ -54,8 +55,8 @@ public final class KeyValue implements Comparable<KeyValue>
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<KeyValue>
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)