jQuery menu onkey press - open menu

jQuery menu onkey press - open menu

I created a jQuery script which would you require to press numpad0 and it would open up a menu. Pasting "jQuery('.panel_toggle').trigger('click');" works and brings up the menu yet having it in a fuction doesn't work. Also I must note that the console registers me pressing numpad0 so that works fine to.



   

  1.     jQuery(document).ready(function()
  2.     {
  3.     jQuery(".panel_toggle").toggle(function()
  4.     { 
  5.     jQuery('#panel_stats').stop().animate({'height':'415px'},500)
  6.     },function()
  7.     {
  8.     jQuery('#panel_stats').stop().animate({'height':'0px'},500)
  9.     });
  10.     
  11.     jQuery('body, html').live('keypress', openMenu)
  12.     });
  13.     function openMenu(e)
  14.     {
  15.     console.log(e.keyCode)
  16.     if(e.keyCode == '96')
  17.     {
  18.     e.preventDefault()
  19.     jQuery('.panel_toggle').trigger('click');
  20.     }
  21.     }

Anyhow I'm very confused.
Thank you for the help.