// Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org>
// Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com>
-// 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 */
init: function () {
this.keyEvents = [];
- XML.ignoreWhitespace = true;
overlay.overlayWindow(window, {
- append: <e4x xmlns={XUL}>
- <window id={document.documentElement.id}>
- <!-- http://developer.mozilla.org/en/docs/XUL_Tutorial:Updating_Commands -->
- <commandset id="dactyl-onfocus" commandupdater="true" events="focus"
- oncommandupdate="dactyl.modules.events.onFocusChange(event);"/>
- <commandset id="dactyl-onselect" commandupdater="true" events="select"
- oncommandupdate="dactyl.modules.events.onSelectionChange(event);"/>
- </window>
- </e4x>.elements()
+ append: [
+ ["window", { id: document.documentElement.id, xmlns: "xul" },
+ // http://developer.mozilla.org/en/docs/XUL_Tutorial:Updating_Commands
+ ["commandset", { id: "dactyl-onfocus", commandupdater: "true", events: "focus",
+ commandupdate: this.closure.onFocusChange }],
+ ["commandset", { id: "dactyl-onselect", commandupdater: "true", events: "select",
+ commandupdate: this.closure.onSelectionChange }]]]
});
this._fullscreen = window.fullScreen;
let duringFeed = this.duringFeed || [];
this.duringFeed = [];
try {
- if (DOM.Event.feedingEvent)
- for (let [k, v] in Iterator(DOM.Event.feedingEvent))
+ let ourEvent = DOM.Event.feedingEvent;
+ DOM.Event.feedingEvent = null;
+ if (ourEvent)
+ for (let [k, v] in Iterator(ourEvent))
if (!(k in event))
event[k] = v;
- DOM.Event.feedingEvent = null;
- let key = DOM.Event.stringify(event);
+ let key = DOM.Event.stringify(ourEvent || event);
+ event.dactylString = key;
// Hack to deal with <BS> and so forth not dispatching input
// events
});
},
- commands: function () {
+ commands: function initCommands() {
commands.add(["delmac[ros]"],
"Delete macros",
function (args) {
completer: function (context) completion.macro(context)
});
},
- completion: function () {
+ completion: function initCompletion() {
completion.macro = function macro(context) {
context.title = ["Macro", "Keys"];
context.completions = [item for (item in events.getMacros())];
};
},
- mappings: function () {
+ mappings: function initMappings() {
mappings.add([modes.MAIN],
["<A-b>", "<pass-next-key-builtin>"], "Process the next key as a builtin mapping",
},
{ count: true });
},
- options: function () {
+ options: function initOptions() {
const Hive = Class("Hive", {
init: function init(values, map) {
this.name = "passkeys:" + map;