mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-21 23:05:46 +01:00
Fix some code in feedkeys.
This commit is contained in:
@@ -733,6 +733,7 @@ liberator.Events = function () //{{{
|
|||||||
|
|
||||||
if (macros.get(lastMacro))
|
if (macros.get(lastMacro))
|
||||||
{
|
{
|
||||||
|
liberator.modes.isReplaying = true;
|
||||||
// make sure the page is stopped before starting to play the macro
|
// make sure the page is stopped before starting to play the macro
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -742,6 +743,7 @@ liberator.Events = function () //{{{
|
|||||||
|
|
||||||
liberator.buffer.loaded = 1; // even if not a full page load, assume it did load correctly before starting the macro
|
liberator.buffer.loaded = 1; // even if not a full page load, assume it did load correctly before starting the macro
|
||||||
res = liberator.events.feedkeys(macros.get(lastMacro), true); // true -> noremap
|
res = liberator.events.feedkeys(macros.get(lastMacro), true); // true -> noremap
|
||||||
|
liberator.modes.isReplaying = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -785,6 +787,7 @@ liberator.Events = function () //{{{
|
|||||||
var doc = window.document;
|
var doc = window.document;
|
||||||
var view = window.document.defaultView;
|
var view = window.document.defaultView;
|
||||||
var escapeKey = false; // \ to escape some special keys
|
var escapeKey = false; // \ to escape some special keys
|
||||||
|
var wasReplaying = liberator.modes.isReplaying;
|
||||||
|
|
||||||
noremap = !!noremap;
|
noremap = !!noremap;
|
||||||
|
|
||||||
@@ -794,7 +797,6 @@ liberator.Events = function () //{{{
|
|||||||
var keyCode = 0;
|
var keyCode = 0;
|
||||||
var shift = false, ctrl = false, alt = false, meta = false;
|
var shift = false, ctrl = false, alt = false, meta = false;
|
||||||
|
|
||||||
liberator.modes.isReplaying = true;
|
|
||||||
//if (charCode == 92) // the '\' key FIXME: support the escape key
|
//if (charCode == 92) // the '\' key FIXME: support the escape key
|
||||||
if (charCode == 60 && !escapeKey) // the '<' key starts a complex key
|
if (charCode == 60 && !escapeKey) // the '<' key starts a complex key
|
||||||
{
|
{
|
||||||
@@ -846,14 +848,15 @@ liberator.Events = function () //{{{
|
|||||||
evt.isMacro = true;
|
evt.isMacro = true;
|
||||||
elem.dispatchEvent(evt);
|
elem.dispatchEvent(evt);
|
||||||
// stop feeding keys if page loading failed
|
// stop feeding keys if page loading failed
|
||||||
if (!liberator.modes.isReplaying)
|
if (wasReplaying) {
|
||||||
break;
|
if (!liberator.modes.isReplaying)
|
||||||
if (!waitForPageLoaded())
|
break;
|
||||||
break;
|
if (!waitForPageLoaded())
|
||||||
|
break;
|
||||||
|
}
|
||||||
// else // a short break between keys often helps
|
// else // a short break between keys often helps
|
||||||
// liberator.sleep(50);
|
// liberator.sleep(50);
|
||||||
}
|
}
|
||||||
liberator.modes.isReplaying = false;
|
|
||||||
return i == keys.length;
|
return i == keys.length;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user