Page 1 of 1

Is it possible to disable default gamepad button handling?

Posted: 03 Oct 2022, 22:25
by dcockerham
We're trying to implement a menu where the gamepad's shoulder buttons, which are mapped to PageLeft and PageRight, are used to change a display in the background. However, the default logic for PageLeft/PageRight moves the target of the Focus. We do NOT want the Focus to be overridden when we press these buttons, and this is causing us some problems. Is there a way to disable this automatic portion of these button inputs so that the only actions triggered by the button presses are the triggers that we define for it?

Re: Is it possible to disable default gamepad button handling?

Posted: 04 Oct 2022, 11:04
by sfernandez
KeyboardNavigation manages the focus when no one else handles the KeyDown event, so you can add a behavior to the menu that sets the e.handled to true for the PreviewKeyDown event when PageLeft and PageRight keys are pressed, could you try that?

Re: Is it possible to disable default gamepad button handling?

Posted: 04 Oct 2022, 23:35
by dcockerham
Ah, looks like that'll do the trick! I was attempting to implement that before and it didn't seem to be working for me so I thought it just wouldn't work for this, but giving it another go now, it seems that I'd just made a mistake in my implementation. Thank you for your time!

Re: Is it possible to disable default gamepad button handling?

Posted: 11 Oct 2022, 10:33
by sfernandez
Great to know it worked, marking this as solved then.