question

ScottBengtson-3454 avatar image
0 Votes"
ScottBengtson-3454 asked ScottBengtson-3454 commented

Xbox: is there a button released event?

Is there any way to track when the left/right trigger is released? It seems to me that SystemTransportMediaControls for Xbox has a ButtonPressed event (GamepadRightTrigger in this case) but no ButtonReleased event. Hoping to invoke a function at such a time.

Gamepad API allows one to loop through and check the status of buttons, but this doesn't seem like a very efficient solution

windows-uwp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

HunterPerry-9234 avatar image
0 Votes"
HunterPerry-9234 answered ScottBengtson-3454 commented

While there is no ButtonReleased event, their should be a KeyUp event if I have the same control that your mentioning


        <MediaTransportControls KeyUp="MediaTransportControls_KeyUp"/>
        
    
  private void MediaTransportControls_KeyUp(object sender, KeyRoutedEventArgs e)
             {
                 if (e.OriginalKey == VirtualKey.GamepadRightTrigger)
                 {
                     //
                 }
             }




· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

That worked great, thank you!

0 Votes 0 ·