on xenial help sign in
Add support for earpiece media buttons Fixes: #1398427

Approved by: Michael Terry

commit10041cfad47ec6d1d1c995ca000eca4a61f6d051 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 21 Jan 2015, 18:32 (12 years ago) parent47c036e897df3d
1 file changed+4−1
qml/Shell.qml+4−1
qml/Shell.qml+4−1
@@ -180,7 +180,10 @@ Item {
180180
181181 WindowKeysFilter {
182182 Keys.onPressed: {
183− if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
183+ // Nokia earpieces give TogglePlayPause, while the iPhone's earpiece gives Play
184+ if (event.key == Qt.Key_MediaTogglePlayPause || event.key == Qt.Key_MediaPlay) {
185+ event.accepted = callManager.handleMediaKey(false);
186+ } else if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
184187 // FIXME: We only consider power key presses if the screen is
185188 // on because of bugs 1410830/1409003. The theory is that when
186189 // those bugs are encountered, there is a >2s delay between the