From 9b2b45edf61387f986bf8524a4eb2eae12566c7e Mon Sep 17 00:00:00 2001 From: Sebastian Nielsen Date: Sun, 28 Mar 2021 07:25:16 +0200 Subject: [PATCH 1/2] Press "ENTER" after each scan Press "ENTER" after each scan. Fixes #3 --- .../main/java/io/rami/barcodekeyboard/BarcodeInputService.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/rami/barcodekeyboard/BarcodeInputService.kt b/app/src/main/java/io/rami/barcodekeyboard/BarcodeInputService.kt index 95f4ba1..5406dd7 100644 --- a/app/src/main/java/io/rami/barcodekeyboard/BarcodeInputService.kt +++ b/app/src/main/java/io/rami/barcodekeyboard/BarcodeInputService.kt @@ -66,6 +66,7 @@ class BarcodeInputService : InputMethodService(), ZXingScannerView.ResultHandler lastTime = System.currentTimeMillis() currentInputConnection.also { ic: InputConnection -> ic.commitText(rawResult.text, 1) + ic.sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER)) } } -} \ No newline at end of file +} From 44ffb897bb294e1c5625034d32182623865a4f82 Mon Sep 17 00:00:00 2001 From: Sebastian Nielsen Date: Sun, 28 Mar 2021 07:41:44 +0200 Subject: [PATCH 2/2] Update BarcodeInputService.kt --- .../main/java/io/rami/barcodekeyboard/BarcodeInputService.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/rami/barcodekeyboard/BarcodeInputService.kt b/app/src/main/java/io/rami/barcodekeyboard/BarcodeInputService.kt index 5406dd7..183be1e 100644 --- a/app/src/main/java/io/rami/barcodekeyboard/BarcodeInputService.kt +++ b/app/src/main/java/io/rami/barcodekeyboard/BarcodeInputService.kt @@ -66,7 +66,7 @@ class BarcodeInputService : InputMethodService(), ZXingScannerView.ResultHandler lastTime = System.currentTimeMillis() currentInputConnection.also { ic: InputConnection -> ic.commitText(rawResult.text, 1) - ic.sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER)) + ic.sendKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER)) } } }