mirror of
https://github.com/apache/cordova-android.git
synced 2025-04-20 07:29:36 +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;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user