abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Keyboard2View.java
diff options
context:
space:
mode:
authorJules Aguillon2022-03-05 18:15:36 +0100
committerJules Aguillon2022-03-05 19:22:01 +0100
commite92504ae92873ca7f0efa80421893bc69f98fa11 (patch)
tree617658973d150e51bb398c1b9b937a5098a5e3fa /srcs/juloo.keyboard2/Keyboard2View.java
parent4964bfb87f8d7dab50990864e274d4bc494f67b0 (diff)
downloadunexpected-keyboard-e92504ae92873ca7f0efa80421893bc69f98fa11.tar.gz
unexpected-keyboard-e92504ae92873ca7f0efa80421893bc69f98fa11.zip
Improve the code for dynamic updates of the layout
Diffstat (limited to 'srcs/juloo.keyboard2/Keyboard2View.java')
-rw-r--r--srcs/juloo.keyboard2/Keyboard2View.java23
1 files changed, 1 insertions, 22 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2View.java b/srcs/juloo.keyboard2/Keyboard2View.java
index 92630ca..e282b0f 100644
--- a/srcs/juloo.keyboard2/Keyboard2View.java
+++ b/srcs/juloo.keyboard2/Keyboard2View.java
@@ -55,28 +55,7 @@ public class Keyboard2View extends View
public void setKeyboard(KeyboardData kw)
{
- if (!_config.shouldOfferSwitchingToNextInputMethod)
- kw = kw.replaceKeys(
- new KeyboardData.ReplaceKeysByEvent(KeyValue.EVENT_CHANGE_METHOD, null));
- if (_config.key_flags_to_remove != 0)
- kw = kw.replaceKeys(
- new KeyboardData.ReplaceKeysByFlags(_config.key_flags_to_remove, null));
- // Replace the action key to show the right label.
- KeyValue action_key = null;
- if (_config.actionLabel != null)
- {
- action_key = new KeyValue(_config.actionLabel, _config.actionLabel,
- KeyValue.CHAR_NONE, KeyValue.EVENT_ACTION, KeyValue.FLAG_NOREPEAT);
- }
- if (_config.swapEnterActionKey && action_key != null)
- kw = kw.replaceKeys(
- new KeyboardData.ReplaceKeysByEvent2(KeyEvent.KEYCODE_ENTER,
- action_key, KeyValue.EVENT_ACTION,
- KeyValue.getKeyByName("enter")));
- else
- kw = kw.replaceKeys(
- new KeyboardData.ReplaceKeysByEvent(KeyValue.EVENT_ACTION, action_key));
- _keyboard = kw;
+ _keyboard = _config.modify_layout(kw);
reset();
}