2 * (C) Copyright 2010 Vinh Q. Nguyen
4 * Use, modification, and distribution are subject to the terms specified in the
10 require("content-buffer.js");
13 define_keymap("google_voice_keymap", $display_name = "google-voice");
14 define_fallthrough(google_voice_keymap, match_any_unmodified_character);
17 define_key(google_voice_keymap, "c", null, $fallthrough);
18 define_key(google_voice_keymap, "m", null, $fallthrough);
19 define_key(google_voice_keymap, "escape", null, $fallthrough);
20 define_key(google_voice_keymap, "/", null, $fallthrough);
21 define_key(google_voice_keymap, "right", null, $fallthrough);
22 define_key(google_voice_keymap, "n", null, $fallthrough);
23 define_key(google_voice_keymap, "left", null, $fallthrough);
24 define_key(google_voice_keymap, "p", null, $fallthrough);
25 define_key(google_voice_keymap, "#", null, $fallthrough);
26 define_key(google_voice_keymap, "!", null, $fallthrough);
27 define_key(google_voice_keymap, "I", null, $fallthrough);
28 define_key(google_voice_keymap, "U", null, $fallthrough);
31 define_key(google_voice_keymap, "g i", null, $fallthrough);
32 define_key(google_voice_keymap, "g s", null, $fallthrough);
33 define_key(google_voice_keymap, "g h", null, $fallthrough);
34 define_key(google_voice_keymap, "g i", null, $fallthrough);
35 define_key(google_voice_keymap, "g r", null, $fallthrough);
36 define_key(google_voice_keymap, "g m", null, $fallthrough);
37 define_key(google_voice_keymap, "g c", null, $fallthrough);
38 define_key(google_voice_keymap, "g u", null, $fallthrough);
39 define_key(google_voice_keymap, "* a", null, $fallthrough);
40 define_key(google_voice_keymap, "* n", null, $fallthrough);
41 define_key(google_voice_keymap, "* r", null, $fallthrough);
42 define_key(google_voice_keymap, "* u", null, $fallthrough);
45 var google_voice_modality = {
46 normal: google_voice_keymap
50 define_page_mode("google-voice-mode",
51 build_url_regex($domain = "google",
54 function enable (buffer) {
55 buffer.content_modalities.push(google_voice_modality);
57 function disable (buffer) {
58 var i = buffer.content_modalities.indexOf(google_voice_modality);
60 buffer.content_modalities.splice(i, 1);
62 $display_name = "Google Voice");
64 page_mode_activate(google_voice_mode);
66 provide("google-voice");