On Thu, Jan 28, 2010 at 4:38 AM, Cyranix <[email protected]> wrote:
>  If anyone has an example of correctly binding a
> key listener to part of the Ubiquity panel, I would greatly appreciate
> seeing it.

const ID = 'something_unique';
CmdUtils.CreateCommand({
  name: 'test new results on keys',
  preview: function pv(pb){
    if(pb.ownerDocument.getElementById(ID)) return;
    function onkd(ev){
      if(!ev.shiftKey || ev.which === ev.view.KeyEvent.DOM_VK_SHIFT) return;
      pb.ownerDocument.getElementById(ID).textContent = ev.which;
      ev.preventDefault();
    }
    var tb = context.chromeWindow.gUbiquity.textBox;
    tb.addEventListener('keydown', onkd, true);
    pb.addEventListener('preview-change', function onpc(){
      tb.removeEventListener('keydown', onkd, true);
      pb.removeEventListener('preview-change', onpc, false);
    }, false);
    pb.innerHTML = <>shift + key<h1 id={ID}>code</h1></>;
  },
});

> I suppose I could hack at an accesskey solution, wiring up some faux-
> button links to ^P/^N and tying into a function for cycling through
> the results, if push comes to shove. But unlike "google image search"
> I'm not trying to activate a currently visible result; I'm trying to
> get different results to appear.

Also see check-google-calendar.

-- 
You received this message because you are subscribed to the Google Groups 
"ubiquity-firefox" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/ubiquity-firefox?hl=en.

Reply via email to