]> git.donarmstrong.com Git - dactyl.git/blobdiff - common/content/key-processors.js
Import r6948 from upstream hg supporting Firefox up to 24.*
[dactyl.git] / common / content / key-processors.js
index e1ba321f46c35b2b446d471481f420974cb4ccf0..08cc401a8f4c2badabf0592dbd3977b6639fe89c 100644 (file)
@@ -1,8 +1,8 @@
-// Copyright (c) 2008-2011 by Kris Maglione <maglione.k at Gmail>
+// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail>
 //
 // This work is licensed for reuse under an MIT license. Details are
 // given in the LICENSE.txt file included with this file.
-/* use strict */
+"use strict";
 
 /** @scope modules */
 
@@ -159,7 +159,7 @@ var ProcessorStack = Class("ProcessorStack", {
         if (this.timer)
             this.timer.cancel();
 
-        let key = DOM.Event.stringify(event);
+        let key = event.dactylString || DOM.Event.stringify(event);
         this.events.push(event);
         if (this.keyEvents)
             this.keyEvents.push(event);
@@ -233,7 +233,7 @@ var KeyProcessor = Class("KeyProcessor", {
 
     append: function append(event) {
         this.events.push(event);
-        let key = DOM.Event.stringify(event);
+        let key = event.dactylString || DOM.Event.stringify(event);
 
         if (this.wantCount && !this.command &&
                 (this.countStr ? /^[0-9]$/ : /^[1-9]$/).test(key))
@@ -250,18 +250,17 @@ var KeyProcessor = Class("KeyProcessor", {
     },
 
     execute: function execute(map, args)
-        let (self = this)
-            function execute() {
-                if (self.preExecute)
-                    self.preExecute.apply(self, args);
+        () => {
+            if (this.preExecute)
+                this.preExecute.apply(this, args);
 
-                args.self = self.main.params.mappingSelf || self.main.mappingSelf || map;
-                let res = map.execute.call(map, args);
+            args.self = this.main.params.mappingSelf || this.main.mappingSelf || map;
+            let res = map.execute.call(map, args);
 
-                if (self.postExecute)
-                    self.postExecute.apply(self, args);
-                return res;
-            },
+            if (this.postExecute)
+                this.postExecute.apply(this, args);
+            return res;
+        },
 
     onKeyPress: function onKeyPress(event) {
         if (event.skipmap)
@@ -322,3 +321,4 @@ var KeyArgProcessor = Class("KeyArgProcessor", KeyProcessor, {
     }
 });
 
+// vim: set fdm=marker sw=4 sts=4 ts=8 et: