diff options
| author | Gero Streng | 2022-09-25 02:23:33 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2022-10-23 22:51:36 +0200 |
| commit | baec5a76ee51e86c8256423924331908da75279f (patch) | |
| tree | cdcd025f45773fc122e4d92f11b1baca6fcd1118 /srcs/juloo.keyboard2/Keyboard2View.java | |
| parent | ea0b873dd826b447c5518f033c9b832fb4be3dbf (diff) | |
| download | unexpected-keyboard-baec5a76ee51e86c8256423924331908da75279f.tar.gz unexpected-keyboard-baec5a76ee51e86c8256423924331908da75279f.zip | |
Add optional NumPad
Shows a NumPad depending on preference:
Never/Landscape/Always
Diffstat (limited to 'srcs/juloo.keyboard2/Keyboard2View.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Keyboard2View.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2View.java b/srcs/juloo.keyboard2/Keyboard2View.java index 4742235..7955aca 100644 --- a/srcs/juloo.keyboard2/Keyboard2View.java +++ b/srcs/juloo.keyboard2/Keyboard2View.java @@ -199,9 +199,13 @@ public class Keyboard2View extends View return null; for (KeyboardData.Key key : row.keys) { - x += (key.shift + key.width) * _keyWidth; - if (tx < x) + float xLeft = x + key.shift * _keyWidth; + float xRight = xLeft + key.width * _keyWidth; + if (tx < xLeft) + return null; + if (tx < xRight) return key; + x = xRight; } return null; } |
