User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: Pause menu gamepad input suddenly stops working

11 Nov 2020, 10:02

Yes, it helps... a couple of questions.

Do your buttons have the property AcceptsReturn set to true (by a style or locally)?
After doing Alt+Tab, if you select a Button (either by using the GamePad or arrow keys), and click the Space key, does the button Click correctly?
 
unvestigate
Topic Author
Posts: 32
Joined: 17 Jan 2018, 09:55

Re: Pause menu gamepad input suddenly stops working

11 Nov 2020, 10:44

It would seem that pressing the space key "clicks" a button before doing an Alt-Tab, but it stops working afterwards, just like the issue with the gamepad. Regarding the AcceptsReturn property, I am unsure how to check that. I am using NocturnalStyle.xaml which IIRC comes with Noesis and I am not knowingly setting the property myself. A quick googling suggested this is a property of the TextBox, not the Button, but I may be wrong.
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: Pause menu gamepad input suddenly stops working

11 Nov 2020, 11:26

I think we got to the source of the problem. If Space key is not working either it means that Noesis view thinks Alt key is still pressed.

If you take a look at our Win32Display integration you will see that handling WM_ACTIVATE we raise Deactivated event which ends calling View->Deactivate(). This call resets all input state (pressed keys, focus, mouse buttons, etc.). And when Win32Display raises Activated event it ends calling View->Activate() which restores any previous focus. But Win32Display also syncs key state:
// Sync key states (they are reset each time window is deactivated)
for (uint32_t i = 0; i < NS_COUNTOF(mKeyTable); i++)
{
  if (mKeyTable[i] != 0 && GetAsyncKeyState(i))
  {
    mKeyDown(this, (Key)mKeyTable[i]);
  }
}
Is your integration calling view Deactivate/Activate when Alt+Tab between applications?
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: Pause menu gamepad input suddenly stops working

11 Nov 2020, 11:30

Regarding the AcceptsReturn property, I am unsure how to check that. I am using NocturnalStyle.xaml which IIRC comes with Noesis and I am not knowingly setting the property myself. A quick googling suggested this is a property of the TextBox, not the Button, but I may be wrong.
I just checked that it is ButtonBase code who overrides KeyboardNavigation::AcceptsReturn property to true. So the default behavior for buttons is accepting both Space and Enter keys for raising the Click event. Sorry for the confusion.
 
unvestigate
Topic Author
Posts: 32
Joined: 17 Jan 2018, 09:55

Re: Pause menu gamepad input suddenly stops working

11 Nov 2020, 11:41

You are right. That was the problem! Adding Activate()/Deactivate() calls fixed the problem. Thank you!
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: Pause menu gamepad input suddenly stops working

11 Nov 2020, 12:03

Anyway, regarding the source of the problem, the cause is we are considering Gamepad_Accept as if Space key was pressed in Button code. And [Alt+Space] key combination was reserved to show system menu in WPF, but gamepad should not follow that path.

We are going to fix it for the next release, here is the ticket #1834 to track it.

Who is online

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