Joshua Gitlin
2006-Feb-08 19:06 UTC
[Rails] AJAX Event Handlers, like shift key pressing...
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 ----------- Due to the recent increase in spam and falsely sent email, I now PGP Sign all of my outgoing mail to prove my identity. This means that you will see an attachment called "PGP.sig" with this message. This attachment can be used to prove that I am who I say I am. If you are not familiar with PGP, you can safely ignore it. For more information, please visit http://www.pgp.com/ or http://www.gnupg.org/ -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 194 bytes Desc: This is a digitally signed message part Url : http://wrath.rubyonrails.org/pipermail/rails/attachments/20060208/1792a90d/PGP.bin
Peter De Berdt
2006-Feb-08 21:37 UTC
[Rails] AJAX Event Handlers, like shift key pressing...
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