1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 03:57:59 +01:00

Tweak revision 13f6e3a205d4 to be less lenient in Input modes by default.

--HG--
extra : rebase_source : efa3bfb79a40002ff21e2006974ad9c142ae2187
This commit is contained in:
Kris Maglione
2011-03-12 11:43:11 -05:00
parent 27de24f852
commit 45ba165366
3 changed files with 16 additions and 3 deletions

View File

@@ -653,6 +653,11 @@ var Editor = Module("editor", {
modes.push(modes.TEXT_EDIT); modes.push(modes.TEXT_EDIT);
}); });
mappings.add([modes.INPUT],
["<BS>", "<Del>", "<Left>", "<Right>", "<Up>", "<Down>"],
"Handled by " + config.host,
function () Events.PASS);
mappings.add([modes.INSERT], mappings.add([modes.INSERT],
["<Space>", "<Return>"], "Expand insert mode abbreviation", ["<Space>", "<Return>"], "Expand insert mode abbreviation",
function () { function () {

View File

@@ -91,7 +91,8 @@ var ProcessorStack = Class("ProcessorStack", {
if (options["timeout"]) if (options["timeout"])
this.timer = services.Timer(this, options["timeoutlen"], services.Timer.TYPE_ONE_SHOT); this.timer = services.Timer(this, options["timeoutlen"], services.Timer.TYPE_ONE_SHOT);
} }
else if (result !== Events.KILL && !this.actions.length && !this.passUnknown) { else if (result !== Events.KILL && !this.actions.length &&
!(this.passUnknown || this.modes.some(function (m) m.passEvent(this), this.events[0]))) {
result = Events.ABORT; result = Events.ABORT;
if (!Events.isEscape(this.events.slice(-1)[0])) if (!Events.isEscape(this.events.slice(-1)[0]))
dactyl.beep(); dactyl.beep();
@@ -107,7 +108,8 @@ var ProcessorStack = Class("ProcessorStack", {
this.events[0].originalTarget.dactylKeyPress = undefined; this.events[0].originalTarget.dactylKeyPress = undefined;
if (result !== Events.PASS || this.events.length > 1) if (result !== Events.PASS || this.events.length > 1)
Events.kill(this.events[this.events.length - 1]); if (result !== Events.ABORT || !this.events[0].isReplay)
Events.kill(this.events[this.events.length - 1]);
if (result === Events.PASS_THROUGH) { if (result === Events.PASS_THROUGH) {
events.passing = true; events.passing = true;
@@ -1544,6 +1546,10 @@ var Events = Module("events", {
modes.push(modes.QUOTE); modes.push(modes.QUOTE);
}); });
mappings.add([modes.BASE],
["<CapsLock>"], "Do Nothing",
function () {});
mappings.add([modes.BASE], mappings.add([modes.BASE],
["<Nop>"], "Do nothing", ["<Nop>"], "Do nothing",
function () {}); function () {});

View File

@@ -468,6 +468,8 @@ var Modes = Module("modes", {
ownsFocus: Class.memoize(function ownsFocus() this.bases.length && this.bases.some(function (b) b.ownsFocus)), ownsFocus: Class.memoize(function ownsFocus() this.bases.length && this.bases.some(function (b) b.ownsFocus)),
passEvent: function passEvent(event) this.input && event.charCode && !(event.ctrlKey || event.altKey || event.metaKey),
passUnknown: Class.memoize(function () options.get("passunknown").getKey(this.name)), passUnknown: Class.memoize(function () options.get("passunknown").getKey(this.name)),
get mask() this, get mask() this,
@@ -541,7 +543,7 @@ var Modes = Module("modes", {
options: function initOptions() { options: function initOptions() {
options.add(["passunknown"], options.add(["passunknown"],
"Pass through unknown keys in these modes", "Pass through unknown keys in these modes",
"regexplist", "^input$", "regexplist", "",
{ {
regexpFlags: "i", regexpFlags: "i",
setter: function (val) { setter: function (val) {