From 0df58034cc2010ddb0e2873e29c9582a90b7bf79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gr=C3=A4b?= Date: Tue, 2 Oct 2018 14:10:26 +0200 Subject: [PATCH] PassPhraseDialog: confirm password on enter key --- .../keychain/ui/PassphraseDialogActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/PassphraseDialogActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/PassphraseDialogActivity.java index 1f646294c..b79c87f23 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/PassphraseDialogActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/PassphraseDialogActivity.java @@ -651,7 +651,11 @@ public class PassphraseDialogActivity extends FragmentActivity { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { // Associate the "done" button on the soft keyboard with the okay button in the view - if (EditorInfo.IME_ACTION_DONE == actionId) { + // and the Enter Key, in case a hard keyboard is used + if (EditorInfo.IME_ACTION_DONE == actionId || + (actionId == EditorInfo.IME_ACTION_UNSPECIFIED && + event.getAction() == KeyEvent.ACTION_DOWN && + event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) { AlertDialog dialog = ((AlertDialog) getDialog()); Button bt = dialog.getButton(AlertDialog.BUTTON_POSITIVE);