# HG changeset patch
# User Antonio Moreno <antonio.moreno@openbravo.com>
# Date 1491571216 -7200
#      Fri Apr 07 15:20:16 2017 +0200
# Node ID 3f169bfa4325f9babb693354649250d20fe40760
# Parent  e114ed16ba90c15b2b62b1007101d564d69a7d10
Fixed issue 35580. Keys will no longer be duplicated if external scanner is not connected
The main problem was that for some reason, in iOS, keypress event always happens, but the keyup event only happens in case there is no external keyboard or scanner connected and the virtual keyboard is used instead, which means that when the virtual keyboard is used, both events are triggered, and the keys appear twice. Therefore, the solution has been to completely disable the use of the keyup event in iOS, and use only the keypress event. No change of behavior is required in other platforms.

diff -r e114ed16ba90 -r 3f169bfa4325 web/org.openbravo.mobile.core/source/component/ob-terminal-component.js
--- a/web/org.openbravo.mobile.core/source/component/ob-terminal-component.js	Wed Apr 05 16:27:17 2017 +0530
+++ b/web/org.openbravo.mobile.core/source/component/ob-terminal-component.js	Fri Apr 07 15:20:16 2017 +0200
@@ -370,7 +370,7 @@
       }
       keeper.addEventListener('keyup', function (k) {
         OB.debug('keyup happened: which:' + k.which);
-        if (OB.UTIL.isIOS() && (k.keyCode === 13 || k.which === 13)) {
+        if (OB.UTIL.isIOS()) {
           return;
         }
         OB.MobileApp.view.keeperKey(k);
