1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-01 03:55:46 +01:00
This commit is contained in:
Kris Maglione
2009-05-30 13:29:17 -04:00
parent 311affb871
commit 5e760406ab

View File

@@ -923,7 +923,7 @@ function Events() //{{{
let wasFeeding = this.feedingKeys; let wasFeeding = this.feedingKeys;
this.feedingKeys = true; this.feedingKeys = true;
this.duringFeed = this.duringFeed || ""; this.duringFeed = this.duringFeed || [];
let wasSilent = commandline.silent; let wasSilent = commandline.silent;
if (silent) if (silent)
commandline.silent = silent; commandline.silent = silent;
@@ -978,10 +978,7 @@ function Events() //{{{
shift = key != key.toLowerCase(); shift = key != key.toLowerCase();
} }
let elem = liberator.focus; let elem = liberator.focus || window.content;
if (!elem)
elem = window.content;
let evt = doc.createEvent("KeyEvents"); let evt = doc.createEvent("KeyEvents");
evt.initKeyEvent("keypress", true, true, view, ctrl, alt, shift, meta, keyCode, charCode); evt.initKeyEvent("keypress", true, true, view, ctrl, alt, shift, meta, keyCode, charCode);
if (typeof noremap == "object") if (typeof noremap == "object")
@@ -1014,11 +1011,12 @@ function Events() //{{{
if (silent) if (silent)
commandline.silent = wasSilent; commandline.silent = wasSilent;
if (this.duringFeed != "") if (this.duringFeed.length)
{ {
let duringFeed = this.duringFeed; let duringFeed = this.duringFeed;
this.duringFeed = ""; this.duringFeed = [];
setTimeout(function () events.feedkeys(duringFeed), 0); for (let [,evt] in Iterator(duringFeed))
evt.target.dispatchEvent(evt);
} }
} }
}, },
@@ -1390,7 +1388,7 @@ function Events() //{{{
} }
else else
{ {
events.duringFeed += key; events.duringFeed.push(event);
return void killEvent(); return void killEvent();
} }
} }
@@ -1509,14 +1507,15 @@ function Events() //{{{
else if (input.pendingArgMap) else if (input.pendingArgMap)
{ {
input.buffer = ""; input.buffer = "";
let tmp = input.pendingArgMap; // must be set to null before .execute; if not let map = input.pendingArgMap;
input.pendingArgMap = null; // input.pendingArgMap is still 'true' also for new feeded keys input.pendingArgMap = null;
// FIXME.
key = key.replace(/^<S-([A-Z])>$/, "$1");
if (key != "<Esc>" && key != "<C-[>") if (key != "<Esc>" && key != "<C-[>")
{ {
if (modes.isReplaying && !waitForPageLoaded()) if (modes.isReplaying && !waitForPageLoaded())
return; return;
map.execute(null, input.count, key);
tmp.execute(null, input.count, key);
} }
} }
// only follow a map if there isn't a longer possible mapping // only follow a map if there isn't a longer possible mapping