From 854d83fa974f17fe0f8066b65391ec770534a07a Mon Sep 17 00:00:00 2001 From: ilya Date: Sun, 18 Apr 2010 19:41:08 -0700 Subject: Add an unmapAll command to the remapping interface. This closes #116. --- commands.js | 13 +++++++++---- options.html | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/commands.js b/commands.js index 701947c2..0e5da3ef 100644 --- a/commands.js +++ b/commands.js @@ -29,14 +29,12 @@ function parseCustomKeyMappings(customKeyMappings) { for (var i = 0; i < lines.length; i++) { if (lines[i][0] == "\"" || lines[i][0] == "#") { continue } split_line = lines[i].split(" "); // TODO(ilya): Support all whitespace. - if (split_line.length < 2) { continue } var lineCommand = split_line[0]; - var key = split_line[1]; if (lineCommand == "map") { - if (split_line.length != 3) { continue } - + if (split_line.length != 3) { continue; } + var key = split_line[1]; var vimiumCommand = split_line[2]; if (!availableCommands[vimiumCommand]) { continue } @@ -45,9 +43,16 @@ function parseCustomKeyMappings(customKeyMappings) { mapKeyToCommand(key, vimiumCommand); } else if (lineCommand == "unmap") { + if (split_line.length != 2) { continue; } + + var key = split_line[1]; + console.log("Unmapping", key); unmapKey(key); } + else if (lineCommand == "unmapAll") { + keyToCommandRegistry = {}; + } } } diff --git a/options.html b/options.html index 68f3ad7b..4cf5853c 100644 --- a/options.html +++ b/options.html @@ -224,6 +224,7 @@