mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +08:00
add volumeupbutton/volumedownbutton events
This commit is contained in:
parent
2625a57fdd
commit
b323f329cc
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user