Forum: Ruby on Rails AJAX Event Handlers, like shift key pressing...

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Joshua Gitlin (Guest)
on 2006-02-08 21:06
(Received via mailing list)
Hey everyone,

I thought I'd seen a demo of an AJAX app that responded to control
key presses, like performing a different action when the shift key is
pressed. What I'd really like to do is have a div change when the
shift key is pressed (to change the text of the link inside it to
indicate what new action will occur when that link is clicked with
shift held down). Is there a rails way of doing this?

-Josh
Peter De Berdt (Guest)
on 2006-02-08 23:38
(Received via mailing list)
On 08 Feb 2006, at 20:06, Joshua Gitlin wrote:

> Hey everyone,
>
> I thought I'd seen a demo of an AJAX app that responded to control
> key presses, like performing a different action when the shift key
> is pressed. What I'd really like to do is have a div change when
> the shift key is pressed (to change the text of the link inside it
> to indicate what new action will occur when that link is clicked
> with shift held down). Is there a rails way of doing this?

I don't believe you can detect a modifier being pressed using
JavaScript (as this is a client-side detection), unless combined with
a conventional keydown.

Check http://www.cross-browser.com/x/examples/shift_mode.php for an
example.


Best regards

Peter De Berdt
This topic is locked and can not be replied to.