From 612657811179eefbb425698fb9a29311a9ee9945 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 15 Jan 2023 23:19:09 +0100 Subject: Avoid switching back from secondary layout automatically Stay on the secondary layout after a config refresh or onStartInputView. The information is kept until the keyboard is restarted. Additionally, move tweaking the secondary layout to the Config class now that physical equality is not needed. --- srcs/juloo.keyboard2/KeyEventHandler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'srcs/juloo.keyboard2/KeyEventHandler.java') diff --git a/srcs/juloo.keyboard2/KeyEventHandler.java b/srcs/juloo.keyboard2/KeyEventHandler.java index d6afb46..3031972 100644 --- a/srcs/juloo.keyboard2/KeyEventHandler.java +++ b/srcs/juloo.keyboard2/KeyEventHandler.java @@ -44,8 +44,7 @@ class KeyEventHandler implements Config.IKeyEventHandler switch (key.getEvent()) { case CONFIG: _recv.showKeyboardConfig(); break; - case SWITCH_TEXT: - case SWITCH_SECOND_BACK: _recv.switch_text(); break; + case SWITCH_TEXT: _recv.switch_text(); break; case SWITCH_NUMERIC: _recv.switch_layout(R.xml.numeric); break; case SWITCH_EMOJI: _recv.setPane_emoji(); break; case SWITCH_BACK_EMOJI: _recv.setPane_normal(); break; @@ -56,6 +55,7 @@ class KeyEventHandler implements Config.IKeyEventHandler conn.performEditorAction(actionId); break; case SWITCH_SECOND: _recv.switch_second(); break; + case SWITCH_SECOND_BACK: _recv.switch_primary(); break; case SWITCH_GREEKMATH: _recv.switch_layout(R.xml.greekmath); break; case CAPS_LOCK: _recv.set_shift_state(true, true); break; } @@ -176,6 +176,7 @@ class KeyEventHandler implements Config.IKeyEventHandler public void showKeyboardConfig(); public void switch_text(); + public void switch_primary(); public void switch_second(); public void switch_layout(int layout_id); -- cgit v1.2.3