From baec5a76ee51e86c8256423924331908da75279f Mon Sep 17 00:00:00 2001 From: Gero Streng Date: Sun, 25 Sep 2022 02:23:33 +0200 Subject: Add optional NumPad Shows a NumPad depending on preference: Never/Landscape/Always --- srcs/juloo.keyboard2/Keyboard2View.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'srcs/juloo.keyboard2/Keyboard2View.java') 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; } -- cgit v1.2.3