# HG changeset patch
# User Rafa Alonso <rafael.alonso@openbravo.com>
# Date 1434383887 -7200
#      Mon Jun 15 17:58:07 2015 +0200
# Node ID f49a0b14c889215340353bbd40331e6064dcdcd3
# Parent  eb036a835d78ecf1883047ce59c43df3ca0dd6de
Fixes issue 30162: The 'OB.MobileApp.keyPressProcessed' variable is correctly deleted

diff -r eb036a835d78 -r f49a0b14c889 web/org.openbravo.mobile.core/source/component/ob-terminal-component.js
--- a/web/org.openbravo.mobile.core/source/component/ob-terminal-component.js	Mon Jun 15 21:42:14 2015 +0200
+++ b/web/org.openbravo.mobile.core/source/component/ob-terminal-component.js	Mon Jun 15 17:58:07 2015 +0200
@@ -218,15 +218,14 @@
     if (OB.MobileApp.model.get('useBarcode') && this.scanMode) {
       return;
     }
-    //Issue 25013. This flag is set by globalKeypressHandler function in ob-keyboard.js
     if (OB.MobileApp.model.get('useBarcode') && OB.MobileApp.keyPressProcessed) {
-      delete OB.MobileApp.keyPressProcessed;
-      return;
+      // Issue 25013. This flag is set by globalKeypressHandler function in ob-keyboard.js
+    } else {
+      this.waterfall('onGlobalKeypress', {
+        keyboardEvent: inEvent
+      });
     }
-
-    this.waterfall('onGlobalKeypress', {
-      keyboardEvent: inEvent
-    });
+    delete OB.MobileApp.keyPressProcessed;
   },
 
   resizeWindow: function () {
