[jQuery] Re: CTRL+S to Insert Record PHP+JQUERY

2009-04-17 Thread Hector Virgen
No need for a div with that code, the keyup and keydown events are observed
at the document level.
-Hector


On Fri, Apr 17, 2009 at 8:52 AM, bharani kumar 
bharanikumariyer...@gmail.com wrote:

 Hi ,
 Can u tell me ,

 i have to create any div ID  ? ,

 Or simply paste this code ?




 jQuery(function($)
 {
 var pressed = {};
  $(document).keydown(function(event)
  {
 // Capture the key being pressed
 var keyCode = event.keyCode;
  pressed[keyCode] = true;
  // Check if 'S' was pressed
  if (83 == keyCode) {
 // Check if Ctrl + S (Windows) or Command + S (Mac) was pressed
  if (pressed[17] || pressed[224]) {
 alert('Custom save dialog!');
  event.preventDefault(); // prevent the default save dialog
 }
 }
  });
  $(document).keyup(function(event)
  {
 delete pressed[event.keyCode];
 });
 });
 --
 உங்கள் நண்பன்
 பரணி  குமார்

 Regards
 B.S.Bharanikumar

 POST YOUR OPINION
 http://bharanikumariyerphp.site88.net/bharanikumar/



[jQuery] Re: CTRL+S to Insert Record PHP+JQUERY

2009-04-16 Thread Jean

do u wanna the sql too? LOL

On Thu, Apr 16, 2009 at 2:24 AM, bharani kumar
bharanikumariyer...@gmail.com wrote:
 Hi All ,
 Can u please tell ,
 How to implement  in jquery, php,,
 Insert record after pressed the CTRL+S in keyboard ,
 Thanks

 --
 உங்கள் நண்பன்
 பரணி  குமார்

 Regards
 B.S.Bharanikumar

 POST YOUR OPINION
 http://bharanikumariyerphp.site88.net/bharanikumar/




-- 
[]´s Jean a.k.a Suissa

Tecnólogo em Análise de Sistemas - UTF-PR
131


[jQuery] Re: CTRL+S to Insert Record PHP+JQUERY

2009-04-16 Thread Ricardo

As far as I know you can't capture key combinations in Javascript, and
even if you could, CTRL+S is a browser shortcut, so it would probably
be overriden.

On Apr 16, 2:24 am, bharani kumar bharanikumariyer...@gmail.com
wrote:
 Hi All ,
 Can u please tell ,

 How to implement  in jquery, php,,

 Insert record after pressed the CTRL+S in keyboard ,

 Thanks

 --
 உங்கள் நண்பன்
 பரணி  குமார்

 Regards
 B.S.Bharanikumar

 POST YOUR OPINIONhttp://bharanikumariyerphp.site88.net/bharanikumar/


[jQuery] Re: CTRL+S to Insert Record PHP+JQUERY

2009-04-16 Thread Hector Virgen
You might be able to capture key combos by observing the document for
keydown and keyup events, and storing the key's down/up state in a variable.
Then, when the 's' key is pressed, check if 'ctrl' is also pressed.
But like Ricardo said, CTRL+S may not be capturable since it's a browser
shortcut.
-Hector


On Thu, Apr 16, 2009 at 9:18 AM, Ricardo ricardob...@gmail.com wrote:


 As far as I know you can't capture key combinations in Javascript, and
 even if you could, CTRL+S is a browser shortcut, so it would probably
 be overriden.

 On Apr 16, 2:24 am, bharani kumar bharanikumariyer...@gmail.com
 wrote:
  Hi All ,
  Can u please tell ,
 
  How to implement  in jquery, php,,
 
  Insert record after pressed the CTRL+S in keyboard ,
 
  Thanks
 
  --
  உங்கள் நண்பன்
  பரணி  குமார்
 
  Regards
  B.S.Bharanikumar
 
  POST YOUR OPINIONhttp://bharanikumariyerphp.site88.net/bharanikumar/



[jQuery] Re: CTRL+S to Insert Record PHP+JQUERY

2009-04-16 Thread Nic Hubbard

http://jshotkeys.googlepages.com/test-static-01.html

On Apr 15, 10:24 pm, bharani kumar bharanikumariyer...@gmail.com
wrote:
 Hi All ,
 Can u please tell ,

 How to implement  in jquery, php,,

 Insert record after pressed the CTRL+S in keyboard ,

 Thanks

 --
 உங்கள் நண்பன்
 பரணி  குமார்

 Regards
 B.S.Bharanikumar

 POST YOUR OPINIONhttp://bharanikumariyerphp.site88.net/bharanikumar/


[jQuery] Re: CTRL+S to Insert Record PHP+JQUERY

2009-04-16 Thread Hector Virgen
Actually, I just tried this and it works in Firefox 3 and IE8 beta.
jQuery(function($)
{
var pressed = {};
 $(document).keydown(function(event)
{
// Capture the key being pressed
var keyCode = event.keyCode;
pressed[keyCode] = true;
 // Check if 'S' was pressed
if (83 == keyCode) {
// Check if Ctrl + S (Windows) or Command + S (Mac) was pressed
if (pressed[17] || pressed[224]) {
alert('Custom save dialog!');
event.preventDefault(); // prevent the default save dialog
}
}
});
 $(document).keyup(function(event)
{
delete pressed[event.keyCode];
});
});
-Hector


On Thu, Apr 16, 2009 at 10:54 AM, Hector Virgen djvir...@gmail.com wrote:

 You might be able to capture key combos by observing the document for
 keydown and keyup events, and storing the key's down/up state in a variable.
 Then, when the 's' key is pressed, check if 'ctrl' is also pressed.
 But like Ricardo said, CTRL+S may not be capturable since it's a browser
 shortcut.
 -Hector



 On Thu, Apr 16, 2009 at 9:18 AM, Ricardo ricardob...@gmail.com wrote:


 As far as I know you can't capture key combinations in Javascript, and
 even if you could, CTRL+S is a browser shortcut, so it would probably
 be overriden.

 On Apr 16, 2:24 am, bharani kumar bharanikumariyer...@gmail.com
 wrote:
  Hi All ,
  Can u please tell ,
 
  How to implement  in jquery, php,,
 
  Insert record after pressed the CTRL+S in keyboard ,
 
  Thanks
 
  --
  உங்கள் நண்பன்
  பரணி  குமார்
 
  Regards
  B.S.Bharanikumar
 
  POST YOUR OPINIONhttp://bharanikumariyerphp.site88.net/bharanikumar/





[jQuery] Re: CTRL+S to Insert Record PHP+JQUERY

2009-04-16 Thread Ricardo

Nice! Forget everything I said :)

I wasn't aware that you could override the browser shortcuts. This
means you can disable search, full-screen and other funcionalities in
FF, including cancelling Alt+F4 or Ctrl+W :O

On Apr 16, 3:06 pm, Nic Hubbard nnhubb...@gmail.com wrote:
 http://jshotkeys.googlepages.com/test-static-01.html

 On Apr 15, 10:24 pm, bharani kumar bharanikumariyer...@gmail.com
 wrote:

  Hi All ,
  Can u please tell ,

  How to implement  in jquery, php,,

  Insert record after pressed the CTRL+S in keyboard ,

  Thanks

  --
  உங்கள் நண்பன்
  பரணி  குமார்

  Regards
  B.S.Bharanikumar

  POST YOUR OPINIONhttp://bharanikumariyerphp.site88.net/bharanikumar/