diff options
| author | Jules Aguillon | 2025-01-25 22:11:36 +0100 |
|---|---|---|
| committer | Jules Aguillon | 2025-01-25 22:31:23 +0100 |
| commit | 188c68279d6c75ed94f82ca7fc0b56c54614f174 (patch) | |
| tree | e3577243d4193c03e5b54b3ce718689786727848 | |
| parent | 3e3fd6ffdae412ac73f0e09ab35040a1b5077358 (diff) | |
| download | unexpected-keyboard-188c68279d6c75ed94f82ca7fc0b56c54614f174.tar.gz unexpected-keyboard-188c68279d6c75ed94f82ca7fc0b56c54614f174.zip | |
Slightly less permissive swipe detection
This allows starting an anticircle gesture on a key with sliders on two
opposite sides.
| -rw-r--r-- | srcs/juloo.keyboard2/Pointers.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/srcs/juloo.keyboard2/Pointers.java b/srcs/juloo.keyboard2/Pointers.java index 12482a5..5ac97c9 100644 --- a/srcs/juloo.keyboard2/Pointers.java +++ b/srcs/juloo.keyboard2/Pointers.java @@ -234,8 +234,9 @@ public final class Pointers implements Handler.Callback private KeyValue getNearestKeyAtDirection(Pointer ptr, int direction) { KeyValue k; - // [i] is [0, -1, 1, -2, 2, ...] - for (int i = 0; i > -4; i = (~i>>31) - i) + // [i] is [0, -1, 1, -2, 2], scanning a 1/4 of the circle's area, centered + // on the initial direction. + for (int i = 0; i > -2; i = (~i>>31) - i) { int d = (direction + i + 16) % 16; // Don't make the difference between a key that doesn't exist and a key |
