dcockerham
Topic Author
Posts: 11
Joined: 10 Apr 2021, 00:44

Is it possible to disable default gamepad button handling?

03 Oct 2022, 22:25

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?
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

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

04 Oct 2022, 11:04

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?
 
dcockerham
Topic Author
Posts: 11
Joined: 10 Apr 2021, 00:44

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

04 Oct 2022, 23:35

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!
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

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

11 Oct 2022, 10:33

Great to know it worked, marking this as solved then.

Who is online

Users browsing this forum: Google [Bot] and 62 guests