Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] Keystroke event


  • From: flavio at economisa.com.br (Flavio Gomes)
  • Subject: [Javascript] Keystroke event
  • Date: Mon Mar 27 07:39:28 2006

In GMail you can use Ctrl+I, Ctrl+U, Ctrl+B for formatting your rich 
text e-mails

I tried for some time to find the code, but it was pretty complicated. 
If you have the time and skills, check it there and then post it here, ok?

Laurent Muchacho escreveu:

> Hi
>
> Thanks for the piece of, As you said this does work but it doesn't 
> stop firefox from opening the "Save Page As" window control.
>
> If you know a way to prevent this from opening it will be great
>
> Many thanks for your help
>
> Laurent
>
> On 3/24/06, *J. Lester Novros II* <lester@xxxxxxxxxxx 
> <mailto:lester@xxxxxxxxxxx>> wrote:
>
>     Dear Laurent,
>
>     Laurent Muchacho wrote:
>     > If anyone got an idea let it come :-)
>
>     This should do it on both Apple and Intel platforms [tested in
>     Firefox/Safari/xPloder - Linux/Mac OS X/windoze]:
>
>     window.onkeydown =
>     function(event)
>     {
>     // normalize event
>         event = event || window.event ;
>
>     // check for the 's'- and command-|control-keys
>         if (event.keyCode == 83 && (navigator.platform == 'MacPPC' ?
>     event.metaKey :
>     event.ctrlKey))
>         {
>            alert('saving...');
>            // insert your saving routine here
>            return false;
>         }
>
>     // pass thru original keypress
>         return true;
>     }
>
>     Would you want it to work in xPloder as well, be aware that it needs
>     'document.onkeydown' rather than the standard ' window.onkeydown';
>     specifying
>     both results in Firefox calling the function twice.
>
>     I'll leave Opera as an exercise to the reader since it wouldn't
>     co-operate with
>     the above code [it still passes the event] in the limited amount
>     of time I had
>     available.
>
>     l8R lES
>     --
>     m$ has a note for this xPloder bug on its website with a
>     description and offers
>     a workaround. It states: "This behavior is by design." The offered
>     workaround
>     does not help at all.
>                                                               http://www.denhaag.org
>     _______________________________________________
>     Javascript mailing list
>     Javascript@xxxxxxxxxx <mailto:Javascript@xxxxxxxxxx>
>     https://lists.LaTech.edu/mailman/listinfo/javascript
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Javascript mailing list
>Javascript@xxxxxxxxxx
>https://lists.LaTech.edu/mailman/listinfo/javascript
>  
>

-- 
Flavio Gomes
flavio@xxxxxxxxxxxxxxxx