From af7515247bbd0c66f4c25bf17f26b7337f77af3d Mon Sep 17 00:00:00 2001 From: Robert Vanden Eynde Date: Wed, 1 Aug 2018 20:03:26 +0200 Subject: [PATCH] Fix refactoring, Ctrl, Alt, Fn keys work again --- .../main/java/com/termux/app/ExtraKeysView.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/termux/app/ExtraKeysView.java b/app/src/main/java/com/termux/app/ExtraKeysView.java index 784aa365..a4073ae0 100644 --- a/app/src/main/java/com/termux/app/ExtraKeysView.java +++ b/app/src/main/java/com/termux/app/ExtraKeysView.java @@ -125,7 +125,7 @@ public final class ExtraKeysView extends GridLayout { public boolean readSpecialButton(SpecialButton name) { SpecialButtonState state = specialButtons.get(name); - if(state == null) + if (state == null) throw new RuntimeException("Must be a valid special button (see source)"); if (! state.isOn) @@ -134,12 +134,12 @@ public final class ExtraKeysView extends GridLayout { if (state.button.isPressed()) return true; - if (state.button.isChecked()) { - state.button.setChecked(false); - state.button.setTextColor(TEXT_COLOR); - } - - return state.button.isChecked(); + if (! state.button.isChecked()) + return false; + + state.button.setChecked(false); + state.button.setTextColor(TEXT_COLOR); + return true; } void popup(View view, String text) {