add volumeupbutton/volumedownbutton events

This commit is contained in:
Julien Bouquillon 2012-05-10 02:04:11 +02:00
parent 2625a57fdd
commit b323f329cc

View File

@ -1087,6 +1087,18 @@ public class DroidGap extends Activity implements CordovaInterface {
return true;
}
// If volumedown key
else if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
this.appView.loadUrl("javascript:cordova.fireDocumentEvent('volumedownbutton');");
return super.onKeyUp(keyCode, event);
}
// If volumeup key
else if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
this.appView.loadUrl("javascript:cordova.fireDocumentEvent('volumeupbutton');");
return super.onKeyUp(keyCode, event);
}
return false;
}