locked
Media keys (play/pause) do not work

    Question

  • I have Logitech K200 keyboard with multimedia keys.

    When I press Play/Pause button, no event is generated by SystemMediaTransportControls.ButtonPressed or MediaControl.PlayPauseTogglePressed or MediaControl.PausePressed.

    I'm able to capture Window.Current.CoreWindow.KeyUp with following args:

    KeyUp VirtualKey=179 KeyStatus={ Extendend=True Released=True ScanCode=0 Down=True }

    but it doesn't work when the app is in background.

    Same button works perfectly with native/desktop apps, for example in WPF it generates following event:

    KeyUp Key=MediaPlayPause KeyStates=None SystemKey=None
    I've noticed that standard Store Apps like Video also do not work.

    Monday, February 02, 2015 9:18 PM

All replies

  • Hi marcinwis,

    Let's say if the app is in background, how could the key press event pass to the app.

     If you press some keys like volumn up or down, it change the system level sound instead of the app sound, if your app is in front, the key down event will be captured and handle by the app, which is your SystemMediaTransportControls.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, February 03, 2015 6:44 AM
    Moderator
  • How about reading some docs before giving irrelevant reply ?

    https://msdn.microsoft.com/library/windows/apps/dn278677

    Tuesday, February 03, 2015 7:55 AM