1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 03:14:12 +01:00

Make <Esc> a normal mapping rather than a grotesque hack.

This commit is contained in:
Kris Maglione
2011-01-19 20:30:54 -05:00
parent a8a840afc2
commit 95eb8aaf93
4 changed files with 19 additions and 32 deletions

View File

@@ -713,27 +713,6 @@ var Events = Module("events", {
modes.remove(modes.MENU);
},
/**
* The global escape key handler. This is called in ALL modes.
*/
onEscape: function () {
switch (modes.main) {
case modes.COMMAND_LINE:
case modes.INSERT:
case modes.OUTPUT_MULTILINE:
case modes.PASS_THROUGH:
case modes.QUOTE:
case modes.TEXT_EDIT:
case modes.VISUAL:
modes.pop();
break;
default:
modes.reset();
break;
}
},
/**
* Ensures that the currently focused element is visible and blurs
* it if it's not.
@@ -1023,9 +1002,6 @@ var Events = Module("events", {
refeed.shift();
}
if (Events.isEscape(key) && !shouldPass())
res = Events.KILL;
if (res !== Events.PASS)
kill(event);
@@ -1041,11 +1017,6 @@ var Events = Module("events", {
catch (e) {
dactyl.reportError(e);
}
finally {
// This is a stupid, silly, and revolting hack.
if (Events.isEscape(key) && !shouldPass())
this.onEscape();
}
},
onKeyUpOrDown: function onKeyUpOrDown(event) {