on xenial help sign in
Add support for earpiece media buttons Fixes: #1398427
10041cfMichael Zanetti
qml/Shell.qml+4−1
@@ -180,7 +180,10 @@ Item {
180
180
181 WindowKeysFilter {
181 WindowKeysFilter {
182 Keys.onPressed: {
182 Keys.onPressed: {
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);
183− if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
186+ } else if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
184 // FIXME: We only consider power key presses if the screen is
187 // FIXME: We only consider power key presses if the screen is
185 // on because of bugs 1410830/1409003. The theory is that when
188 // on because of bugs 1410830/1409003. The theory is that when
186 // those bugs are encountered, there is a >2s delay between the
189 // those bugs are encountered, there is a >2s delay between the