mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-04-25 18:31:25 +02:00
Add 'passkeys' option.
This commit is contained in:
@@ -645,7 +645,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
let res = <res>
|
let res = <res>
|
||||||
<dt>{link(obj.name)}</dt> <dd>{obj.description ? obj.description.replace(/\.$/, "") : ""}</dd>
|
<dt>{link(obj.name)}</dt> <dd>{obj.description ? obj.description.replace(/\.$/, "") : ""}</dd>
|
||||||
<item>
|
<item>
|
||||||
<tags>{template.map(obj.names, tag, " ")}</tags>
|
<tags>{template.map(obj.names.reverse, tag, " ")}</tags>
|
||||||
<spec>{spec((obj.specs || obj.names)[0])}</spec>{
|
<spec>{spec((obj.specs || obj.names)[0])}</spec>{
|
||||||
!obj.type ? "" : <>
|
!obj.type ? "" : <>
|
||||||
<type>{obj.type}</type>
|
<type>{obj.type}</type>
|
||||||
|
|||||||
@@ -818,6 +818,8 @@ const Events = Module("events", {
|
|||||||
modes.pop();
|
modes.pop();
|
||||||
mode = modes.getStack(1);
|
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)
|
// handle Escape-all-keys mode (Ctrl-q)
|
||||||
|
|
||||||
if (stop) {
|
if (stop) {
|
||||||
@@ -959,7 +961,7 @@ const Events = Module("events", {
|
|||||||
// Prevent certain sites from transferring focus to an input box
|
// Prevent certain sites from transferring focus to an input box
|
||||||
// before we get a chance to process our key bindings on the
|
// before we get a chance to process our key bindings on the
|
||||||
// "keypress" event.
|
// "keypress" event.
|
||||||
if (!Events.isInputElemFocused() && !modes.passThrough)
|
if (!Events.isInputElemFocused() && !modes.passThrough && !options.get("passkeys").has(events.toString(event)))
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1094,6 +1096,24 @@ const Events = Module("events", {
|
|||||||
{ arg: true, count: true });
|
{ arg: true, count: true });
|
||||||
},
|
},
|
||||||
options: function () {
|
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"],
|
options.add(["strictfocus", "sf"],
|
||||||
"Prevent scripts from focusing input elements without user intervention",
|
"Prevent scripts from focusing input elements without user intervention",
|
||||||
"boolean", true);
|
"boolean", true);
|
||||||
|
|||||||
@@ -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>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>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>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>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>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>
|
<dt><o>private</o></dt> <dd>Set the 'private browsing' option</dd>
|
||||||
|
|||||||
@@ -1087,9 +1087,8 @@
|
|||||||
</item>
|
</item>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<tags>'pageinfo' 'pa'</tags>
|
<tags>'pa' 'pageinfo'</tags>
|
||||||
<spec>'pageinfo' 'pa'</spec>
|
<spec>'pageinfo' 'pa'</spec>
|
||||||
|
|
||||||
<type>charlist</type>
|
<type>charlist</type>
|
||||||
<default>gfm</default>
|
<default>gfm</default>
|
||||||
<description>
|
<description>
|
||||||
@@ -1110,6 +1109,23 @@
|
|||||||
</description>
|
</description>
|
||||||
</item>
|
</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>
|
<item>
|
||||||
<tags>'pps' 'popups'</tags>
|
<tags>'pps' 'popups'</tags>
|
||||||
<spec>'popups' 'pps'</spec>
|
<spec>'popups' 'pps'</spec>
|
||||||
|
|||||||
+2
-1
@@ -78,7 +78,8 @@
|
|||||||
* Added "passwords" and "venkman" dialogs to :dialog.
|
* Added "passwords" and "venkman" dialogs to :dialog.
|
||||||
* Added :extupdate command.
|
* Added :extupdate command.
|
||||||
* Replaced 'focuscontent' with 'strictfocus'.
|
* Replaced 'focuscontent' with 'strictfocus'.
|
||||||
* Add :if/:elseif/:else/:endif conditionals.
|
* Added :if/:elseif/:else/:endif conditionals.
|
||||||
|
* Added 'passkeys' option.
|
||||||
* Changed 'urlseparator' default value to '|'.
|
* Changed 'urlseparator' default value to '|'.
|
||||||
* Added 'wildanchor' option.
|
* Added 'wildanchor' option.
|
||||||
* Added -javascript option to :abbrev and :map.
|
* Added -javascript option to :abbrev and :map.
|
||||||
|
|||||||
Reference in New Issue
Block a user