1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-12 11:05:47 +01:00

Add 'passkeys' option.

This commit is contained in:
Kris Maglione
2010-11-04 09:02:12 -04:00
parent d89110813c
commit f1b8e7ee7e
5 changed files with 43 additions and 5 deletions

View File

@@ -645,7 +645,7 @@ const Dactyl = Module("dactyl", {
let res = <res>
<dt>{link(obj.name)}</dt> <dd>{obj.description ? obj.description.replace(/\.$/, "") : ""}</dd>
<item>
<tags>{template.map(obj.names, tag, " ")}</tags>
<tags>{template.map(obj.names.reverse, tag, " ")}</tags>
<spec>{spec((obj.specs || obj.names)[0])}</spec>{
!obj.type ? "" : <>
<type>{obj.type}</type>

View File

@@ -818,6 +818,8 @@ const Events = Module("events", {
modes.pop();
mode = modes.getStack(1);
}
else if (!event.isMacro && !event.noremap && options.get("passkeys").has(events.toString(event)))
stop = true;
// handle Escape-all-keys mode (Ctrl-q)
if (stop) {
@@ -959,7 +961,7 @@ const Events = Module("events", {
// Prevent certain sites from transferring focus to an input box
// before we get a chance to process our key bindings on the
// "keypress" event.
if (!Events.isInputElemFocused() && !modes.passThrough)
if (!Events.isInputElemFocused() && !modes.passThrough && !options.get("passkeys").has(events.toString(event)))
event.stopPropagation();
},
@@ -1094,6 +1096,24 @@ const Events = Module("events", {
{ arg: true, count: true });
},
options: function () {
options.add(["passkeys", "pk"],
"Pass certain keys through directly for the given URLs",
"regexpmap", "", {
has: function (key) {
let url = buffer.URI;
for (let re in values(this.value))
if (re.test(url) && re.result.some(function (k) k === key))
return true;
return false;
},
setter: function (values) {
values.forEach(function (re) {
re.result = events.fromString(re.result).map(events.closure.toString);
re.result.toString = function toString() this.join("");
});
return values;
}
});
options.add(["strictfocus", "sf"],
"Prevent scripts from focusing input elements without user intervention",
"boolean", true);

View File

@@ -407,6 +407,7 @@ This file contains a list of all available commands, mappings and options.
<dt><o>nextpattern</o></dt> <dd>Patterns to use when guessing the 'next' page in a document sequence</dd>
<dt><o>online</o></dt> <dd>Set the 'work offline' option</dd>
<dt><o>pageinfo</o></dt> <dd>Desired info in the <ex>:pageinfo</ex> output</dd>
<dt><o>passkeys</o></dt> <dd>Pass certain keys through directly for the given URLs</dd>
<dt><o>popups</o></dt> <dd>Where to show requested popup windows</dd>
<dt><o>previouspattern</o></dt> <dd>Patterns to use when guessing the 'previous' page in a document sequence</dd>
<dt><o>private</o></dt> <dd>Set the 'private browsing' option</dd>

View File

@@ -1087,9 +1087,8 @@
</item>
<item>
<tags>'pageinfo' 'pa'</tags>
<tags>'pa' 'pageinfo'</tags>
<spec>'pageinfo' 'pa'</spec>
<type>charlist</type>
<default>gfm</default>
<description>
@@ -1110,6 +1109,23 @@
</description>
</item>
<item>
<tags>'pk' 'passkeys'</tags>
<spec>'passkeys' 'pk'</spec>
<type>regexpmap</type>
<default/>
<description>
<p>
Pass certain keys through directly for the given URLs.
For any page with a URL matching a given regexp, all key
events for keys listed in that regexp's value are passed
through directly to &dactyl.host;, and are not processed
by &dactyl.appName; in any way.
</p>
<example><ex>:set passkeys+=</ex><str delim="'">https://mail\.google\.com/</str>:<str delim="">jk<k name="Return"/></str></example>
</description>
</item>
<item>
<tags>'pps' 'popups'</tags>
<spec>'popups' 'pps'</spec>

View File

@@ -78,7 +78,8 @@
* Added "passwords" and "venkman" dialogs to :dialog.
* Added :extupdate command.
* Replaced 'focuscontent' with 'strictfocus'.
* Add :if/:elseif/:else/:endif conditionals.
* Added :if/:elseif/:else/:endif conditionals.
* Added 'passkeys' option.
* Changed 'urlseparator' default value to '|'.
* Added 'wildanchor' option.
* Added -javascript option to :abbrev and :map.