title: menubutton not working anymore after upgrade to cordova 5+cordova android 4.0.0
body: <p>I've recently upgraded to cordova 5 and removed/recreated android platform in version 4.0.0 and uninstalled/reinstalled all plugins.</p>
  
  <p>I also had to upgrade android sdk to sdk 22 instead of 21.</p>
  
  <p>Since the update, I'm no more able to catch the menubutton event as described in <a href="https://cordova.apache.org/docs/en/5.0.0/cordova_events_events.md.html#menubutton">the cordova documentation</a>.</p>
  
  <p>As it's still referenced in the edge docs, I assume it should still be working and I've seen nothing about this in the release notes.</p>
  
  <p>back button is still working.</p>
  
  <p>I tried to set the target-sdk to 19, it did not solve anything about the issue.</p>
  
  <p><strong>Edit:</strong>
  I've dug into cordova source code and found in CordovaWebViewImpl.java I found a suspicious TODO comment :</p>
  
  <pre><code>   public void setButtonPlumbedToJs(int keyCode, boolean override) {
          switch (keyCode) {
              case KeyEvent.KEYCODE_VOLUME_DOWN:
              case KeyEvent.KEYCODE_VOLUME_UP:
              case KeyEvent.KEYCODE_BACK:
                  // TODO: Why are search and menu buttons handled separately?
                  if (override) {
                      boundKeyCodes.add(keyCode);
                  } else {
                      boundKeyCodes.remove(keyCode);
                  }
                  return;
              default:
                  throw new IllegalArgumentException("Unsupported keycode: " + keyCode);
          }
      }
  </code></pre>
  
  <p>Well my answer would be "IT SHOULDN'T!!!!"</p>
  
  <p>Cordova makes a list of keycode to handle but does not add the menu button and later on the keycode is compared to KeyEvent.KEYCODE_MENU only after the keycode has been skipped because it's not in the list.</p>
  
  <p>I've tried to add a case for the menu button, but it turns out the function is only called with the code of the back button.</p>
  
  <p>So now I know why it doesn't work but still not how to fix it.</p>
  
  <p><strong>Edit 02/2016:</strong>
  As per <a href="https://issues.apache.org/jira/browse/CB-9949">latest Jira</a>, the support of the menubutton is now fixed in java part in Cordova Android 5.1.0 but still not initialized from the javascript.
  For the moment, as indicated by Jira user Keith Wong, you need to add a javascript call before you add your event listener :</p>
  
  <pre><code>document.addEventListener("deviceready", function() {
      ...
      navigator.app.overrideButton("menubutton", true);  // &lt;-- Add this line
      document.addEventListener("menubutton", yourCallbackFunction, false);
      ...
  }, false);
  </code></pre>