diff options
| author | Jules Aguillon | 2021-04-15 23:23:31 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2021-04-15 23:23:31 +0200 |
| commit | c22ca7302c16773dbe1971323034dd6e23d9611b (patch) | |
| tree | a5b84667fc1a8dbee93c75d5935246663f7705a9 /srcs/juloo.keyboard2/Keyboard2View.java | |
| parent | eac74d3f2283ec9f36e595261ab21716d910c15a (diff) | |
| download | unexpected-keyboard-c22ca7302c16773dbe1971323034dd6e23d9611b.tar.gz unexpected-keyboard-c22ca7302c16773dbe1971323034dd6e23d9611b.zip | |
Stateless KeyboardData class
It was a pain to use. It was also a pain to write this though.
Diffstat (limited to 'srcs/juloo.keyboard2/Keyboard2View.java')
| -rw-r--r-- | srcs/juloo.keyboard2/Keyboard2View.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2View.java b/srcs/juloo.keyboard2/Keyboard2View.java index 041b881..84159b2 100644 --- a/srcs/juloo.keyboard2/Keyboard2View.java +++ b/srcs/juloo.keyboard2/Keyboard2View.java @@ -87,7 +87,10 @@ public class Keyboard2View extends View public void setKeyboard(KeyboardData keyboard) { - _keyboard = keyboard; + if (_config.disableAccentKeys) + _keyboard = keyboard.removeKeys(new KeyboardData.RemoveKeysByFlags(KeyValue.FLAGS_ACCENTS)); + else + _keyboard = keyboard; reset(); } @@ -195,7 +198,7 @@ public class Keyboard2View extends View if (touchY < y || touchY >= (y + _config.keyHeight)) continue ; x = (KEY_PER_ROW * _keyWidth - row.getWidth(_keyWidth)) / 2 + _config.horizontalMargin; - for (KeyboardData.Key key : row) + for (KeyboardData.Key key : row.getKeys()) { keyW = _keyWidth * key.width; if (touchX >= x && touchX < (x + keyW)) @@ -343,7 +346,7 @@ public class Keyboard2View extends View for (KeyboardData.Row row : _keyboard.getRows()) { x = (KEY_PER_ROW * _keyWidth - row.getWidth(_keyWidth)) / 2f + _config.horizontalMargin; - for (KeyboardData.Key k : row) + for (KeyboardData.Key k : row.getKeys()) { float keyW = _keyWidth * k.width; KeyDown keyDown = getKeyDown(k); |
