View Issue Details

IDProjectCategoryView StatusLast Update
0001517NoesisGUIC# SDKpublic2020-07-07 16:36
Reporterai_enabled Assigned Tosfernandez  
PrioritynormalSeveritymajorReproducibilityrandom
Status resolvedResolutionno change required 
Product Version2.2.3 
Summary0001517: Random issue with typing and modifier keys
DescriptionHi guys,

probably this is my MonoGame wrapper's code issue only, however, I'm curious if you have similar reports from other devs.

The issue is that sometimes modifier key (reproducible for Ctrl, not sure about the other keys) is stuck for NoesisGUI. The subsequent keypresses/chars are not typed into the textbox. And presses of keys A and V results in Ctrl+A and Ctrl+V which is obviously not great :-)
The only workaround is to press the Ctrl key few times, the issue then disappears.

Oh, and this issue is very-very old.

If you have any ideas or suggestions how could I debug the issue — please let me know.

Regards!
TagsNo tags attached.
PlatformAny

Relationships

related to 0001457 resolvedsfernandez Shift + mouse wheel = horizontal scroll 

Activities

sfernandez

sfernandez

2019-07-11 12:36

manager   ~0005839

Hi,

Noesis only responds to the input provided by the integration layer, it doesn't interact with the operating system, so all the key downs and ups should be provided by the MonoGame wrapper.
Could it be a problem that appears when you deactivate the window and come back? Or does it happen without changing the foreground window?
Is there a way to easily reproduce it in your game that I can try?
ai_enabled

ai_enabled

2019-07-19 19:01

updater   ~0005882

Alas, there is no easy way to reproduce it. I'm looking to find a way and yes, probably you're right as this might be affected by the integration layer. Though I've checked it several times. I will add extra logging to find out whether the modified key was actually sent as released to NoesisGUI or not, then I will know for sure whether it's wrapper or NoesisGUI issue.

I believe it's related to the usage of Alt+Tab.

Turns out the issue 0001503 ("Click on the currently selected listbox item will deselect it") is related to it. My Ctrl key for NoesisGUI was assumed to be held so every time I clicked on an entry in a list box it was deselected as NoesisGUI processed it as Ctrl+Click.

Regards!
ai_enabled

ai_enabled

2020-05-06 22:45

updater   ~0006323

Hi guys,

the issue is bothering us and our players a lot.
It's Ctrl key getting stuck sometimes. So pressing A key will perform Ctrl+A (select all). Pressing any other key after that will replace the selected text which is really frustrating.

It's absolutely random. But happens very often to some players who are using the chat a lot. Pressing the Ctrl key several times usually resolves it.

I've added logging to verify that the Ctrl key is definitely released when that issue happens—and it looks like the "key up" was sent to NoesisGUI properly by our wrapper.
So I believe there is something wrong inside NoesisGUI...
Do you have similar issues reported by other developers? Or other developers barely using in-game chat so this issue just has very little chance to occur there?

Regards!
sfernandez

sfernandez

2020-05-08 10:55

manager   ~0006331

Reviewing our code I can only identify two scenarios where control key could be kept as pressed.

- If the View receives a KeyDown for the LeftCtrl key, and a KeyUp for the RightCtrl key. As they are different phisycal keys, but both report Ctrl modifier as down, it could lead to the situation explained.
- If KeyDown was sent to the View for LeftCtrl (or RightCtrl), then Alt+Tab or click in other application without calling Deactivate on the View, and come back to the game after releasing the Ctrl key.

Is it possible that any of that is happening in your situation?
Is this something I can try to reproduce with the latest game build you sent? Just typing in the chat box and pressing Ctrl sometimes?

If you need it I can generate a debug library with some logs to determine when our internal key state gets out of sync.
ai_enabled

ai_enabled

2020-05-09 01:56

updater   ~0006341

Last edited: 2020-05-09 01:58

Hi Sergio,
thank you for the message. I was mostly interested if you have any other developers complaining about this issue. It seems we're alone with it! :-) Didn't want to waste your time, sorry!

I've prepared a special client build with extra logging and made it public in Steam (`patch-testing` branch). Selected players started using it. I've instructed them to press Alt+F4 as soon as they notice the Ctrl key getting stuck in any textbox (usually, chat, but also the game console). The log will contain info about the KeyDown/KeyUp events sent to NoesisGUI as well as the cases when the input is ignored (there are several cases related to IME processing; I've also noticed there was a workaround for old bug #1270 that is long-ago fixed so the workaround is no longer necessary!). I will let you know when I get more data from players. I hope it's an issue in my wrapper code after all!

Anyway:
1) It's unlikely that players are using the Right Ctrl at all. I never use it and the issue still happened to me.
2) If the game window is not focused, the game recognizes this as "empty input" so if there was a key held before Alt-Tab, it's released immediately. This is a simple and effective solution. When the game window focused again the game reads the current input state and provides it to NoesisGUI key down events (if there are any keys pressed).
To get current input state we're using this PInvoke call (through MonoGame Keyboard API):
    [DllImport("user32.dll")]
    private static extern bool GetKeyboardState(byte[] lpKeyState);

Regards!

sfernandez

sfernandez

2020-05-10 12:43

manager   ~0006342

Sorry to say we don't have any other report about this issue, but it could still be a bug in our side. Let's see if we can get more information and find the source of the problem.

I downloaded CryoFall demo from steam and switched to the patch-testing branch, but it seems no Data or Log folder is created. Maybe this only works for the full version of the game?
ai_enabled

ai_enabled

2020-05-10 13:03

updater   ~0006343

The Steam version is using Documents/AtomicTorchStudio or %LocalAppDats%/AtomicTorchStudio folder for thr dynamic data.

I don't get this issue reports for a day. It might have been that old workaround that caused wrapper to not send KeyUp sometimes.
ai_enabled

ai_enabled

2020-05-11 20:10

updater   ~0006346

Hi Sergio,
today we're pushing the new game build with an updated wrapper code (that doesn't contain the workaround for #1270 that stayed for too long and likely caused this key stuck issue before).
If the issue is not reproducible by anyone after that we can consider it fixed.

Regards!
ai_enabled

ai_enabled

2020-07-07 14:08

updater   ~0006508

The issue is definitely fixed.
It was a wrapper code issue after all.
It was really important to carefully record all the key down events to ensure the key up events will be submitted to NoesisGUI for these keys no matter what :)

Regards!
sfernandez

sfernandez

2020-07-07 16:36

manager   ~0006510

Thanks for the update, we're closing this then.

Issue History

Date Modified Username Field Change
2019-07-11 11:53 ai_enabled New Issue
2019-07-11 12:36 sfernandez Assigned To => sfernandez
2019-07-11 12:36 sfernandez Status new => feedback
2019-07-11 12:36 sfernandez Note Added: 0005839
2019-07-19 19:01 ai_enabled Note Added: 0005882
2019-07-19 19:01 ai_enabled Status feedback => assigned
2020-05-06 22:45 ai_enabled Note Added: 0006323
2020-05-08 10:55 sfernandez Note Added: 0006331
2020-05-08 12:27 jsantos Relationship added related to 0001457
2020-05-09 01:56 ai_enabled Note Added: 0006341
2020-05-09 01:57 ai_enabled Note Edited: 0006341
2020-05-09 01:57 ai_enabled Note Edited: 0006341
2020-05-09 01:58 ai_enabled Note Edited: 0006341
2020-05-10 12:43 sfernandez Note Added: 0006342
2020-05-10 13:03 ai_enabled Note Added: 0006343
2020-05-11 20:10 ai_enabled Note Added: 0006346
2020-07-07 14:08 ai_enabled Note Added: 0006508
2020-07-07 16:36 sfernandez Status assigned => resolved
2020-07-07 16:36 sfernandez Resolution open => no change required
2020-07-07 16:36 sfernandez Note Added: 0006510