issue #22500: move barcode scanner code out of core
authorSteve Hackbarth <stephenhackbarth@gmail.com>
Wed, 22 Jan 2014 17:41:51 +0000 (12:41 -0500)
committerSteve Hackbarth <stephenhackbarth@gmail.com>
Wed, 22 Jan 2014 17:41:51 +0000 (12:41 -0500)
enyo-client/application/source/app.js
lib/enyo-x/source/app.js

index 989f4d9..12c3018 100644 (file)
@@ -9,17 +9,13 @@ white:true*/
     name: "App",
     kind: "XV.App",
     keyCapturePatterns: [
-      {method: "captureMagstripe", start: [16, 53, 16, 66], end: [191, 13], falsePositives: 1},
-      {method: "captureBarcodeScanner", start: [192], end: [13]}
+      {method: "captureMagstripe", start: [16, 53, 16, 66], end: [191, 13], falsePositives: 1}
     ],
     components: [
       { name: "postbooks", kind: "XV.Postbooks",  onTransitionStart: "handlePullout" },
       { name: "pullout", kind: "XV.Pullout", onAnimateFinish: "pulloutAnimateFinish" },
       { name: "signals", kind: enyo.Signals, onkeydown: "handleKeyDown" }
     ],
-    captureBarcodeScanner: function (value) {
-      this.$.postbooks.getActive().waterfall("onBarcodeCapture", {data: value});
-    },
     captureMagstripe: function (value) {
       var parseMagstripe = function (input) {
         var parseObj = {};
index 20e2b53..67357d1 100644 (file)
@@ -46,6 +46,16 @@ white:true*/
       var that = this,
         keyCode = inEvent.keyCode;
 
+      // XXX start hacks
+      if (keyCode === 189) {
+        // Dashes aren't coming through as dashes from my keyboard
+        keyCode = '-'.charCodeAt(0);
+      } else if (keyCode === 56 && inEvent.shiftKey) {
+        // there's gotta be a way to know that shift-8 is *
+        keyCode = '*'.charCodeAt(0);
+      }
+      // XXX end hacks
+
       // remember the last 10 key presses
       this._keyBufferArray.push(keyCode);
       this._keyBufferArray = this._keyBufferArray.slice(-10);
@@ -56,10 +66,6 @@ white:true*/
         return;
       }
 
-      if (keyCode === 189) {
-        // XXX FIXME hack. Dashes aren't coming through as dashes from my keyboard
-        keyCode = '-'.charCodeAt(0);
-      }
       if (inEvent.altKey) {
         inEvent.cancelBubble = true;
         inEvent.returnValue = false;
@@ -319,6 +325,7 @@ white:true*/
         details = XT.session.details;
         loginInfo.setContent(details.username + " ยท " + details.organization);
         this.state = RUNNING;
+        XM.Tuplespace.trigger("activate");
         XT.app.$.postbooks.activate();
       }
     },