title: Capturing back key press on PhoneGap for Android
body: <p>I am using PhoneGap for Android Application development and I'm stuck at capturing the back key press on the device! I tried everything from other threads and from the official wiki page but none seem to work! :(</p>
  
  <p>I could capture menu and search keys with keyEvent.menuTrigger and keyEvent.searchTrigger but can't seem to capture the back button press! I tried keyEvent.backTrigger similarly but it didn't work! Adding event listener for 'backKeyDown' event doesn't work either! </p>
  
  <p>Here's my code:</p>
  
  <pre><code>BackButton.override();
      document.addEventListener('backKeyDown', function(e) {
    console.log('Caught it!');
  }, false);
  keyEvent.searchTrigger= searchPressed;
  keyEvent.menuTrigger=menuPressed;
  keyEvent.backTrigger=backPressed;
  </code></pre>
  
  <p>The console says:</p>
  
  <pre><code>Line 1 : Uncaught TypeError: Cannot call method 'backTrigger' of undefined
  </code></pre>
  
  <p>Doesn't that mean something.backTrigger() is being called but the object something doesn't exist. What is that something? Or is there any way around?</p>
  
  <p>Tried the same with KeyEvent too, with no luck!
  Please help!</p>
  
  <p>Thanks in advance! :)</p>