InputControl problem

Oct 25, 2010 at 3:38 PM

Hi,

I'm testing this great framework and I found an error using the UserInterface demo (with 3.1).

If we try to enter any character using the right alt and another key, for instance to display the char "@", it will not display nothing and all other controls in the demo stopped responding.

Can you help me how to figure this out?

 

Many thanks,

Prymor

Coordinator
Oct 30, 2010 at 11:01 AM

Hi!

Someone else reported a similar issue via email. In his case, the XNA window apparently didn't get all WM_KEYUP messages (as far as I can tell, AltGr is Ctrl + Alt combined), so the GUI assumed the user was holding down the Ctrl key. Pressing either of the Ctrl keys on the keyboard normalized the situation again. Is the behavior the same in your case?

We didn't have time to debug the issue properly and his users didn't need to enter any '@' characters, so he simply filtered the control key via an adapter class between the GuiManager and the IInputCapturer.

 

I'm having trouble reproducing the issue because I'm using an English keyboard. If you have the time, could you run Spy++ (comes with the full Visual Studio editions) or ManagedSpy (available from Microsoft, couldn't get it to run on my system) to capture the window messages sent to the XNA game window when you press and release the AltGr key?

I could then simulate the key on my system by sending those messages manually ;-)

Nov 13, 2010 at 2:32 PM

Hi Cygon

Sorry for my late reply.

Please find below the required output:

 

SPY++ MESSAGES LOG

->>>>> Messages when "ALTGR" key is pressed and released one time without any key combination
<00021> 000908A6 P WM_KEYDOWN nVirtKey:VK_CONTROL cRepeat:1 ScanCode:1D fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00022> 000908A6 S WM_GETDLGCODE
<00023> 000908A6 R WM_GETDLGCODE fuDlgCode:DLGC_WANTALLKEYS | DLGC_WANTCHARS
<00024> 000908A6 P WM_KEYDOWN nVirtKey:VK_MENU cRepeat:1 ScanCode:38 fExtended:1 fAltDown:1 fRepeat:0 fUp:0
<00025> 000908A6 S WM_QUERYUISTATE
<00026> 000908A6 R WM_QUERYUISTATE
<00027> 000908A6 S WM_QUERYUISTATE
<00028> 000908A6 R WM_QUERYUISTATE
<00029> 000908A6 P WM_SYSKEYUP nVirtKey:VK_CONTROL cRepeat:1 ScanCode:1D fExtended:0 fAltDown:1 fRepeat:1 fUp:1
<00030> 000908A6 P WM_KEYUP nVirtKey:VK_MENU cRepeat:1 ScanCode:38 fExtended:1 fAltDown:0 fRepeat:1 fUp:1
->>>>>>>>>>>>>>>>>>>>>


->>>>> Messages when "ALTGR" key is pressed and maintained pressed for a while without any key combination
<00477> 000908A6 P WM_KEYDOWN nVirtKey:VK_CONTROL cRepeat:1 ScanCode:1D fExtended:0 fAltDown:1 fRepeat:1 fUp:0
<00478> 000908A6 P WM_KEYDOWN nVirtKey:VK_MENU cRepeat:1 ScanCode:38 fExtended:1 fAltDown:1 fRepeat:1 fUp:0
<00479> 000908A6 S WM_QUERYUISTATE
<00480> 000908A6 R WM_QUERYUISTATE
<00481> 000908A6 S WM_QUERYUISTATE
<00482> 000908A6 R WM_QUERYUISTATE
<00483> 000908A6 P WM_KEYDOWN nVirtKey:VK_CONTROL cRepeat:1 ScanCode:1D fExtended:0 fAltDown:1 fRepeat:1 fUp:0
<00484> 000908A6 P WM_KEYDOWN nVirtKey:VK_MENU cRepeat:1 ScanCode:38 fExtended:1 fAltDown:1 fRepeat:1 fUp:0
<00485> 000908A6 S WM_QUERYUISTATE
<00486> 000908A6 R WM_QUERYUISTATE
<00487> 000908A6 S WM_QUERYUISTATE
<00488> 000908A6 R WM_QUERYUISTATE
<00489> 000908A6 P WM_KEYDOWN nVirtKey:VK_CONTROL cRepeat:1 ScanCode:1D fExtended:0 fAltDown:1 fRepeat:1 fUp:0
<00490> 000908A6 P WM_KEYDOWN nVirtKey:VK_MENU cRepeat:1 ScanCode:38 fExtended:1 fAltDown:1 fRepeat:1 fUp:0
<00491> 000908A6 S WM_QUERYUISTATE
<00492> 000908A6 R WM_QUERYUISTATE
->>> lines repetead several times
->>>>>>>>>>>>>>>>>>>>>>>


->>>>> Messages when "ALTGR" key is pressed with key "2" once
<00067> 000908A6 P WM_KEYDOWN nVirtKey:VK_CONTROL cRepeat:1 ScanCode:1D fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00068> 000908A6 S WM_GETDLGCODE
<00069> 000908A6 R WM_GETDLGCODE fuDlgCode:DLGC_WANTALLKEYS | DLGC_WANTCHARS
<00070> 000908A6 P WM_KEYDOWN nVirtKey:VK_MENU cRepeat:1 ScanCode:38 fExtended:1 fAltDown:1 fRepeat:0 fUp:0
<00071> 000908A6 S WM_QUERYUISTATE
<00072> 000908A6 R WM_QUERYUISTATE
<00073> 000908A6 S WM_QUERYUISTATE
<00074> 000908A6 R WM_QUERYUISTATE
<00075> 000908A6 P WM_KEYDOWN nVirtKey:'2' cRepeat:1 ScanCode:03 fExtended:0 fAltDown:1 fRepeat:0 fUp:0
<00076> 000908A6 P WM_KEYUP nVirtKey:'2' cRepeat:1 ScanCode:03 fExtended:0 fAltDown:1 fRepeat:1 fUp:1
<00077> 000908A6 P WM_SYSKEYUP nVirtKey:VK_CONTROL cRepeat:1 ScanCode:1D fExtended:0 fAltDown:1 fRepeat:1 fUp:1
<00078> 000908A6 P WM_KEYUP nVirtKey:VK_MENU cRepeat:1 ScanCode:38 fExtended:1 fAltDown:0 fRepeat:1 fUp:1
->>>>>>>>>>>>>>>>>>>>>>>

 

Many thanks for your help,

Prymor

Coordinator
Nov 18, 2010 at 3:52 PM

Yay, thanks! I'm able to reproduce it now.

Expect a fix soon :D

Coordinator
Dec 12, 2010 at 4:41 PM

The issue is located & eradicated in the current SVN trunk :)

I've got some more work to do to support mocking the new DirectInput-related stuff in Nuclex.Input (which is the library responsible for capturing keyboard input in the GUI), I'll try to get a new release out after that!