I''d like to leave some debug code on a website, the debug window made visible with an onClick event on some object, but requiring CTRL-ALT or some combination to be held down. Is it possible to check state of keyboard keys in an onClick handler, or can anyone suggest some other technique which casual visitors would not stumble upon? Sam _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Sure can... inspect the event object... i forget the exact names of the properties you want, but http://www.w3schools.com is great for looking this stuff up... and instead of Ctrl Alt, might i suggest something harder to guess, like: up, up, down, down, left, right, left, right, b, a, select, start? Oops, maybe you''re not making AjaxContra, huh? :-O On 7/10/06, Sam <sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote:> > I''d like to leave some debug code on a website, the debug window made > visible with an onClick event on some object, but requiring CTRL-ALT or some > combination to be held down. > > Is it possible to check state of keyboard keys in an onClick handler, or > can anyone suggest some other technique which casual visitors would not > stumble upon? > > Sam > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
I appreciate your help. I''m still at a loss. Let me ask again with specifics. I had in mind adding an onClick event handler to an image. I wasn''t able to field keypress events on the image (if I ) and I was wondering if I could interrogate the CTRL and ALT keys during the onClick event? Sam Sure can... inspect the event object... i forget the exact names of the properties you want, but http://www.w3schools.com is great for looking this stuff up... and instead of Ctrl Alt, might i suggest something harder to guess, like: up, up, down, down, left, right, left, right, b, a, select, start? Oops, maybe you''re not making AjaxContra, huh? :-O On 7/10/06, Sam <sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote: I''d like to leave some debug code on a website, the debug window made visible with an onClick event on some object, but requiring CTRL-ALT or some combination to be held down. Is it possible to check state of keyboard keys in an onClick handler, or can anyone suggest some other technique which casual visitors would not stumble upon? Sam _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org <mailto:Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Google search for "javascript detecting keys pressed during click" reveals this as the first result... http://www.webreference.com/js/column11/modifierkeys.html On 7/11/06, Sam <sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote:> > I appreciate your help. I''m still at a loss. Let me ask again with > specifics. > > I had in mind adding an onClick event handler to an image. I wasn''t able > to field keypress events on the image (if I ) and I was wondering if I could > interrogate the CTRL and ALT keys during the onClick event? > > Sam > > > Sure can... inspect the event object... i forget the exact names of the > properties you want, but http://www.w3schools.com is great for looking > this stuff up... > > and instead of Ctrl Alt, might i suggest something harder to guess, like: > up, up, down, down, left, right, left, right, b, a, select, start? Oops, > maybe you''re not making AjaxContra, huh? :-O > > On 7/10/06, Sam <sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote: > > > > I''d like to leave some debug code on a website, the debug window made > > visible with an onClick event on some object, but requiring CTRL-ALT or some > > combination to be held down. > > > > Is it possible to check state of keyboard keys in an onClick handler, or > > can anyone suggest some other technique which casual visitors would not > > stumble upon? > > > > Sam > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
The okClick event handler will pass an Event into your function which means the reference page you''re looking for is here: http://www.w3schools.com/htmldom/dom_obj_event.asp Cheers Ajax -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]On Behalf Of Sam Sent: Tuesday, July 11, 2006 8:40 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails-spinoffs] Hiding an event to launch a debug window I appreciate your help. I''m still at a loss. Let me ask again with specifics. I had in mind adding an onClick event handler to an image. I wasn''t able to field keypress events on the image (if I ) and I was wondering if I could interrogate the CTRL and ALT keys during the onClick event? Sam Sure can... inspect the event object... i forget the exact names of the properties you want, but http://www.w3schools.com is great for looking this stuff up... and instead of Ctrl Alt, might i suggest something harder to guess, like: up, up, down, down, left, right, left, right, b, a, select, start? Oops, maybe you''re not making AjaxContra, huh? :-O On 7/10/06, Sam <sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote: I''d like to leave some debug code on a website, the debug window made visible with an onClick event on some object, but requiring CTRL-ALT or some combination to be held down. Is it possible to check state of keyboard keys in an onClick handler, or can anyone suggest some other technique which casual visitors would not stumble upon? Sam _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Not only did someone beat me to it, but my name is apparently ajax now... way to go me... :\ Cheers Joe... not Ajax -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]On Behalf Of Bauser, Joseph (Joe) Sent: Tuesday, July 11, 2006 9:42 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails-spinoffs] Hiding an event to launch a debug window The okClick event handler will pass an Event into your function which means the reference page you''re looking for is here: http://www.w3schools.com/htmldom/dom_obj_event.asp Cheers Ajax -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]On Behalf Of Sam Sent: Tuesday, July 11, 2006 8:40 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails-spinoffs] Hiding an event to launch a debug window I appreciate your help. I''m still at a loss. Let me ask again with specifics. I had in mind adding an onClick event handler to an image. I wasn''t able to field keypress events on the image (if I ) and I was wondering if I could interrogate the CTRL and ALT keys during the onClick event? Sam Sure can... inspect the event object... i forget the exact names of the properties you want, but http://www.w3schools.com is great for looking this stuff up... and instead of Ctrl Alt, might i suggest something harder to guess, like: up, up, down, down, left, right, left, right, b, a, select, start? Oops, maybe you''re not making AjaxContra, huh? :-O On 7/10/06, Sam <sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote: I''d like to leave some debug code on a website, the debug window made visible with an onClick event on some object, but requiring CTRL-ALT or some combination to be held down. Is it possible to check state of keyboard keys in an onClick handler, or can anyone suggest some other technique which casual visitors would not stumble upon? Sam _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Just to drive a point home... that site also has a search function. :-) On 7/11/06, Bauser, Joseph (Joe) <Joseph.Bauser-9sMr025MA47QT0dZR+AlfA@public.gmane.org> wrote:> > The okClick event handler will pass an Event into your function which > means the reference page you''re looking for is here: > > http://www.w3schools.com/htmldom/dom_obj_event.asp > > Cheers > > Ajax > > -----Original Message----- > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto: > rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]On Behalf Of Sam > Sent: Tuesday, July 11, 2006 8:40 AM > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: RE: [Rails-spinoffs] Hiding an event to launch a debug window > > > I appreciate your help. I''m still at a loss. Let me ask again with > specifics. > > I had in mind adding an onClick event handler to an image. I wasn''t able > to field keypress events on the image (if I ) and I was wondering if I could > interrogate the CTRL and ALT keys during the onClick event? > > Sam > > > > Sure can... inspect the event object... i forget the exact names of the > properties you want, but http://www.w3schools.com is great for looking > this stuff up... > > and instead of Ctrl Alt, might i suggest something harder to guess, like: > up, up, down, down, left, right, left, right, b, a, select, start? Oops, > maybe you''re not making AjaxContra, huh? :-O > > > On 7/10/06, Sam <sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote: > I''d like to leave some debug code on a website, the debug window made > visible with an onClick event on some object, but requiring CTRL-ALT or some > combination to be held down. > > Is it possible to check state of keyboard keys in an onClick handler, or > can anyone suggest some other technique which casual visitors would not > stumble upon? > > Sam > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Lol... "Ajax Joe"... hey if you don''t have a blog yet that''s a great name for a blog. On 7/11/06, Bauser, Joseph (Joe) <Joseph.Bauser-9sMr025MA47QT0dZR+AlfA@public.gmane.org> wrote:> > Not only did someone beat me to it, but my name is apparently ajax now... > way to go me... :\ > > Cheers > Joe... not Ajax > > > -----Original Message----- > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]On Behalf Of > Bauser, Joseph (Joe) > Sent: Tuesday, July 11, 2006 9:42 AM > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: RE: [Rails-spinoffs] Hiding an event to launch a debug window > > > The okClick event handler will pass an Event into your function which > means the reference page you''re looking for is here: > > http://www.w3schools.com/htmldom/dom_obj_event.asp > > Cheers > > Ajax > > -----Original Message----- > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto: > rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]On Behalf Of Sam > Sent: Tuesday, July 11, 2006 8:40 AM > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: RE: [Rails-spinoffs] Hiding an event to launch a debug window > > > I appreciate your help. I''m still at a loss. Let me ask again with > specifics. > > I had in mind adding an onClick event handler to an image. I wasn''t able > to field keypress events on the image (if I ) and I was wondering if I could > interrogate the CTRL and ALT keys during the onClick event? > > Sam > > > > Sure can... inspect the event object... i forget the exact names of the > properties you want, but http://www.w3schools.com is great for looking > this stuff up... > > and instead of Ctrl Alt, might i suggest something harder to guess, like: > up, up, down, down, left, right, left, right, b, a, select, start? Oops, > maybe you''re not making AjaxContra, huh? :-O > > > On 7/10/06, Sam <sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote: > I''d like to leave some debug code on a website, the debug window made > visible with an onClick event on some object, but requiring CTRL-ALT or some > combination to be held down. > > Is it possible to check state of keyboard keys in an onClick handler, or > can anyone suggest some other technique which casual visitors would not > stumble upon? > > Sam > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
www.quircksmode.com <http://www.quircksmode.com/> specifically for starters http://www.quirksmode.org/js/introevents.html Sam, no offense, but read up please. -Andrew Martinez -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]On Behalf Of Ryan Gahl Sent: Tuesday, July 11, 2006 9:47 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] Hiding an event to launch a debug window Lol... "Ajax Joe"... hey if you don''t have a blog yet that''s a great name for a blog. On 7/11/06, Bauser, Joseph (Joe) < <mailto:Joseph.Bauser-9sMr025MA47QT0dZR+AlfA@public.gmane.org> Joseph.Bauser-9sMr025MA47QT0dZR+AlfA@public.gmane.org> wrote: Not only did someone beat me to it, but my name is apparently ajax now... way to go me... :\ Cheers Joe... not Ajax -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto: <mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]On Behalf Of Bauser, Joseph (Joe) Sent: Tuesday, July 11, 2006 9:42 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails-spinoffs] Hiding an event to launch a debug window The okClick event handler will pass an Event into your function which means the reference page you''re looking for is here: http://www.w3schools.com/htmldom/dom_obj_event.asp Cheers Ajax -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]On Behalf Of Sam Sent: Tuesday, July 11, 2006 8:40 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails-spinoffs] Hiding an event to launch a debug window I appreciate your help. I''m still at a loss. Let me ask again with specifics. I had in mind adding an onClick event handler to an image. I wasn''t able to field keypress events on the image (if I ) and I was wondering if I could interrogate the CTRL and ALT keys during the onClick event? Sam Sure can... inspect the event object... i forget the exact names of the properties you want, but http://www.w3schools.com is great for looking this stuff up... and instead of Ctrl Alt, might i suggest something harder to guess, like: up, up, down, down, left, right, left, right, b, a, select, start? Oops, maybe you''re not making AjaxContra, huh? :-O On 7/10/06, Sam < sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote: I''d like to leave some debug code on a website, the debug window made visible with an onClick event on some object, but requiring CTRL-ALT or some combination to be held down. Is it possible to check state of keyboard keys in an onClick handler, or can anyone suggest some other technique which casual visitors would not stumble upon? Sam _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
I appreciate the posts and regret requesting what is obvious to many, but I wasn''t sure what was meant by "this stuff" below. Sam -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Ryan Gahl Sent: Monday, July 10, 2006 10:04 PM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] Hiding an event to launch a debug window Sure can... inspect the event object... i forget the exact names of the properties you want, but http://www.w3schools.com is great for looking this stuff up... and instead of Ctrl Alt, might i suggest something harder to guess, like: up, up, down, down, left, right, left, right, b, a, select, start? Oops, maybe you''re not making AjaxContra, huh? :-O On 7/10/06, Sam <sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote: I''d like to leave some debug code on a website, the debug window made visible with an onClick event on some object, but requiring CTRL-ALT or some combination to be held down. Is it possible to check state of keyboard keys in an onClick handler, or can anyone suggest some other technique which casual visitors would not stumble upon? Sam _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org <mailto:Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
"this stuff" = generic non-prototype and non-scriptaculous help. Also my previous email: www.quirksmore.ORG <http://www.quirksmore.org/> , the first link I typed .COM -Andrew Martinez -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]On Behalf Of Sam Sent: Tuesday, July 11, 2006 10:01 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails-spinoffs] Hiding an event to launch a debug window I appreciate the posts and regret requesting what is obvious to many, but I wasn''t sure what was meant by "this stuff" below. Sam -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Ryan Gahl Sent: Monday, July 10, 2006 10:04 PM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] Hiding an event to launch a debug window Sure can... inspect the event object... i forget the exact names of the properties you want, but http://www.w3schools.com is great for looking this stuff up... and instead of Ctrl Alt, might i suggest something harder to guess, like: up, up, down, down, left, right, left, right, b, a, select, start? Oops, maybe you''re not making AjaxContra, huh? :-O On 7/10/06, Sam < sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org> wrote: I''d like to leave some debug code on a website, the debug window made visible with an onClick event on some object, but requiring CTRL-ALT or some combination to be held down. Is it possible to check state of keyboard keys in an onClick handler, or can anyone suggest some other technique which casual visitors would not stumble upon? Sam _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
I recently wanted to do something similar with showing a debug output DIV. Here''s my code: var BugTool = Class.create(); BugTool.prototype = { element: null, initialize: function(element, options) { this.element = $(element); Event.observe(document, "keyup", this.onKeyUp.bindAsEventListener(this), false); }, onKeyUp: function(e) { if(ev.ctrlKey && ev.shiftKey && ev.keyCode == 66) { // Ctrl+Shift+B Effect.toggle(this.element, "appear"); } } } might be of some use _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Thanks. I appreciate your response and acknowledge that this question was too off-topic for this forum. Sam -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Justin McCormack Sent: Tuesday, July 11, 2006 10:49 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails-spinoffs] Hiding an event to launch a debug window I recently wanted to do something similar with showing a debug output DIV. Here''s my code: var BugTool = Class.create(); BugTool.prototype = { element: null, initialize: function(element, options) { this.element = $(element); Event.observe(document, "keyup", this.onKeyUp.bindAsEventListener(this), false); }, onKeyUp: function(e) { if(ev.ctrlKey && ev.shiftKey && ev.keyCode == 66) { // Ctrl+Shift+B Effect.toggle(this.element, "appear"); } } } might be of some use _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs