Adding keypress Event on a dialog button

Adding keypress Event on a dialog button

 Hi,

I'm using jquery ui to pop up some dialog for my user. Most of the time my dialog have a cancel button to close  or Ok button to validate the action.

How can i add the support of the return key (code 13) for the "Ok" button

You can find below how i'm setting up my dialog :

   
  1.  $('#heure_dialog').dialog({
  2. bgiframe:true,
  3. autoOpen:false,
  4. height:150,
  5. modal:true,
  6. close:function(){
  7. $('#heure').val('');
  8. }
  9. });
   
  1.  $('#heures td').click(function(){
  2. $('#heure_dialog').dialog('option','buttons',{
  3. 'OK':function(){
  4. // Do something when this button is clicked or Return is pushed
  5. },
  6. 'Cancel' : function(){
  7. $(this).dialog('close');
  8. }
  9. });
  10. $("#heure_dialog").dialog("open");
  11. });
So , how can i add a keypress event on the "OK" button ?

Thanks for your help and i apologize for my approximative english.