2 * (C) Copyright 2007-2008 Jeremy Maitin-Shepard
3 * (C) Copyright 2008-2010 John J. Foerch
5 * Use, modification, and distribution are subject to the terms specified in the
11 define_input_mode("quote_next", "quote_next_keymap",
12 $display_name = "input:QUOTE(next)",
13 $doc = "This input mode sends the next key combo to the buffer, "+
14 "bypassing Conkeror's normal key handling. The mode disengages "+
15 "after one key combo.");
18 define_buffer_mode('quote_mode',
19 $display_name = 'QUOTE',
20 $enable = function (buffer) {
21 buffer.override_keymaps([quote_keymap]);
23 $disable = function (buffer) {
24 buffer.override_keymaps();
26 $doc = "This mode sends all key combos to the buffer, "+
27 "bypassing normal key handling, until the escape "+
31 interactive("quote-mode-disable",
32 "Disable quote-mode.",
34 quote_mode(I.buffer, false);
35 I.buffer.set_input_mode();
39 define_key_match_predicate('match_not_escape_key', 'any key but escape',
41 return event.keyCode != 27 ||
44 event.metaKey || // M-escape can also leave this mode, so we need to use an accurate determination of whether the "M" modifier was pressed, which is not necessarily the same as event.metaKey.