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

Move fallthrough handler proccessing until after all normal key handling. Make MOW mode a COMMAND mode. Move most input processing into INPUT mode. Fixes unnecessary closing of the MOW on :.

This commit is contained in:
Kris Maglione
2011-01-19 20:20:54 -05:00
parent 260a8aad1b
commit a8a840afc2
3 changed files with 30 additions and 40 deletions

View File

@@ -982,10 +982,6 @@ var Events = Module("events", {
input.postExecute = params.postExecute;
if (params.onEvent && input.hive === mappings.builtinHive)
input.fallthrough = function (event) {
// Bloody hell.
if (events.toString(event) === "<C-h>")
event.dactylString = "<BS>";
return params.onEvent(event) === false ? Events.KILL : Events.PASS;
};
}
@@ -1006,6 +1002,14 @@ var Events = Module("events", {
break;
}
if (!refeed || refeed.length == 1)
for (let input in values(processors))
if (input.fallthrough) {
if (res === Events.KILL)
break;
res = dactyl.trapErrors(input.fallthrough, input, event);
}
if (!ownsBuffer)
statusline.updateInputBuffer(buffer);
@@ -1143,19 +1147,6 @@ var Events = Module("events", {
let res = this.onKeyPress(event);
if (res === Events.KILL)
kill(event);
else if (this.fallthrough) {
let evt = isArray(res) ? res[0] : event;
let r = dactyl.trapErrors(this.fallthrough, this, evt);
if (r === Events.KILL)
kill(evt);
res = r === Events.KILL ? Events.KILL : Events.PASS;
/*
if (r === Events.KILL)
res = res.slice(1);
else
res = r == Events.WAIT ? res : false;
*/
}
if (res != Events.WAIT)
this.inputBuffer = "";