Skip to content

Commit

Permalink
Slightly less permissive swipe detection
Browse files Browse the repository at this point in the history
This allows starting an anticircle gesture on a key with sliders on two
opposite sides.
  • Loading branch information
Julow committed Jan 25, 2025
1 parent 3e3fd6f commit 188c682
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions srcs/juloo.keyboard2/Pointers.java
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,9 @@ KeyValue getKeyAtDirection(KeyboardData.Key k, int direction)
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
Expand Down

0 comments on commit 188c682

Please sign in to comment.