diff options
| author | Rodrigo Batista de Moraes | 2022-05-06 19:08:20 -0300 |
|---|---|---|
| committer | Jules Aguillon | 2022-05-08 16:55:03 +0200 |
| commit | bce0a98f623e79968a912894684009926f041b2d (patch) | |
| tree | 61971fc05105c09ea065bea265b42c777e23bd6d /srcs/juloo.keyboard2/KeyboardData.java | |
| parent | a27c64479f158e840c717e81d2345b2eaca23e47 (diff) | |
| download | unexpected-keyboard-bce0a98f623e79968a912894684009926f041b2d.tar.gz unexpected-keyboard-bce0a98f623e79968a912894684009926f041b2d.zip | |
only vibrate when the swipe key changes
Diffstat (limited to 'srcs/juloo.keyboard2/KeyboardData.java')
| -rw-r--r-- | srcs/juloo.keyboard2/KeyboardData.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/srcs/juloo.keyboard2/KeyboardData.java b/srcs/juloo.keyboard2/KeyboardData.java index e996c50..d261725 100644 --- a/srcs/juloo.keyboard2/KeyboardData.java +++ b/srcs/juloo.keyboard2/KeyboardData.java @@ -195,9 +195,11 @@ class KeyboardData return new Key(key0, key1, key2, key3, key4, width * s, shift, edgekeys); } - public KeyValue getValue(int index) + + /* Get the KeyValue at the given direction. See Pointers.onTouchMove() for the represented direction */ + public KeyValue getAtDirection(int direction) { - if (index == 0 || index > 8) return key0; + if (direction == 0 || direction > 8) return key0; KeyValue key = null; if (edgekeys) { // \ 1 / @@ -207,7 +209,7 @@ class KeyboardData // / 4 \ // first closer - switch (index) + switch (direction) { case 2: case 3: key = key1; break; case 4: case 8: key = key2; break; @@ -216,7 +218,7 @@ class KeyboardData } if (key != null) return key; // second closer - switch (index) + switch (direction) { case 1: case 4: key = key1; break; case 3: case 7: key = key2; break; @@ -225,7 +227,7 @@ class KeyboardData } if (key != null) return key; // third closer - switch (index) + switch (direction) { case 5: case 8: key = key1; break; case 2: case 6: key = key2; break; @@ -234,7 +236,7 @@ class KeyboardData } if (key != null) return key; // fourth closer - switch (index) + switch (direction) { case 6: case 7: key = key1; break; case 1: case 5: key = key2; break; @@ -251,7 +253,7 @@ class KeyboardData // | // 3 | 4 // first closer - switch (index) + switch (direction) { case 1: case 2: key = key1; break; case 3: case 4: key = key2; break; @@ -260,7 +262,7 @@ class KeyboardData } if (key != null) return key; // second closer - switch (index) + switch (direction) { case 3: case 5: key = key1; break; case 2: case 8: key = key2; break; @@ -269,7 +271,7 @@ class KeyboardData } if (key != null) return key; // third closer - switch (index) + switch (direction) { case 4: case 6: key = key1; break; case 1: case 7: key = key2; break; @@ -278,7 +280,7 @@ class KeyboardData } if (key != null) return key; // fourth closer - switch (index) + switch (direction) { case 7: case 8: key = key1; break; case 3: case 4: key = key2; break; |
