Page 1 of 1
left and right bug
Posted: Fri Oct 08, 2021 2:32 pm
by 3DH
Translator:
It will be hard to describe, especially with a translator. When I'm on the galaxy map, I have to use the directions on the keyboard because for some reason I can't do it on the joystick. Maybe you can fix it someday, but I mean something else. I play full screen and sometimes go to the desktop (Alt+Tab). And sometimes when I go back to the galaxy map, the left and right keys stop working. But only on the galaxy map. Then I have to use the mouse, especially for that one thing. It's a bit annoying.
Please do something with this.
Re: left and right bug
Posted: Fri Oct 08, 2021 3:52 pm
by Cholmondely
3DH wrote: βFri Oct 08, 2021 2:32 pm
Please do something about this.
I presume that whoever tries to answer might need some of the following information:
*Do you have the same effect when you play the "Strict" game or with no oxp's loaded?
*If the effect exists without oxp's, is it one of the various Linux operating systems? Or something else?
*Also: is it the regular Oolite v.1.90 - or one of the others (Developer Release or Nightly Build)
Re: left and right bug
Posted: Fri Oct 08, 2021 4:06 pm
by Cody
3DH wrote: βFri Oct 08, 2021 2:32 pmI play full screen and sometimes go to the desktop (Alt+Tab). And sometimes when I go back to the galaxy map, the left and right keys stop working.
No problem here (tested on 1.90 and 1.91).
Re: left and right bug
Posted: Fri Oct 08, 2021 4:06 pm
by 3DH
I'm using Windows 10 and Oolite 1.90. I have one add-on modified by me, but these are just minor changes to the HUD. This error also occurred without this add-on. I remind you that the error occurs sometimes.
I do something like this:
- load the game, set up the galaxy map
- alt+tab and enter the Edge browser, click, mark text, etc.
- I am coming back alt+tab to Oolite
- I go alt+tab back to Edge, I'm doing something there again
- I'm going back to Oolite and usually this is where I get this bug. I always have it sooner or later.
Re: left and right bug
Posted: Fri Oct 08, 2021 9:52 pm
by phkb
Can I get you to try something? When you next encounter the issue, press and release each of the shift, control and alt keys, one at a time (not altogether). Then see if the issue has cleared up.
Re: left and right bug
Posted: Sat Oct 09, 2021 8:52 am
by 3DH
Pressing Alt unlocked the left and right keys. Thanks. But what exactly happened here?
Re: left and right bug
Posted: Sat Oct 09, 2021 11:02 am
by phkb
I think itβs a bug in the Oolite code which I came across while working on the new keyboard config setup. I need to do some more analysis on how to correct it, though.
Re: left and right bug
Posted: Sat Oct 09, 2021 8:25 pm
by hiran
phkb wrote: βSat Oct 09, 2021 11:02 am
I think itβs a bug in the Oolite code which I came across while working on the new keyboard config setup. I need to do some more analysis on how to correct it, though.
I do not think it is a bug in Oolite.
What happens is that Oolite notices all keypress and keyrelease events. So pressing Alt is definitely something that Oolite will notice.
However at the moment that Tab is pressed and the fact that Alt is already pressed, the comination Alt-Tab is intercepted by the OS, which reacts and switches the focus to some other application. After the switch all keyboard events are sent to the now focued application, which is no longer Oolite. So far everything worked as designed.
The only unexpected thing that comes up is: Oolite never received a keyrelease event for Alt. So when you return focus to Oolite, it sill believes that Alt is pressed even though it may have been released in the meantime. All further keypresses are executed as Alt-<keypress>, and obviously these do not trigger the same actions that the simple keypress would.
The solution to press the Alt key and release it means you synchronize keyboard status with what Oolite believes to be the keyboard status and the problem is gone.
This is by no means specific to Oolite - I have experienced it with various other games. And I am not sure how one would resolve it within Oolite.
Edit: While thinking again, I suspect the situaton would only arise if you Alt-Tab away from Oolite and then use the mouse to return. If you were to Alt-Tab back to Oolite, the first keyboard event that Oolite might notice could be the release of the Alt key which would not lead to any problem.
Edit2: Would the Oolite window notice that focus went away or came back? Then that event could be used to clear all the modifier values...
Re: left and right bug
Posted: Sun Oct 10, 2021 10:38 am
by 3DH
hiran wrote: βSat Oct 09, 2021 8:25 pm
Edit: While thinking again, I suspect the situaton would only arise if you Alt-Tab away from Oolite and then use the mouse to return. If you were to Alt-Tab back to Oolite, the first keyboard event that Oolite might notice could be the release of the Alt key which would not lead to any problem.
Alt+Tab and the mouse used to return can cause this bug.
Re: left and right bug
Posted: Sun Oct 10, 2021 12:25 pm
by another_commander
hiran wrote: βSat Oct 09, 2021 8:25 pm
Edit2: Would the Oolite window notice that focus went away or came back? Then that event could be used to clear all the modifier values...
Yes, Oolite reacts to receiving focus (WM_SETFOCUS message) and clears all modifier key values already.
Re: left and right bug
Posted: Mon Oct 11, 2021 9:56 pm
by hiran
another_commander wrote: βSun Oct 10, 2021 12:25 pm
hiran wrote: βSat Oct 09, 2021 8:25 pm
Edit2: Would the Oolite window notice that focus went away or came back? Then that event could be used to clear all the modifier values...
Yes, Oolite reacts to receiving focus (WM_SETFOCUS message) and clears all modifier key values already.
Rats.
There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened. - Douglas Adams
Re: left and right bug
Posted: Tue Oct 12, 2021 12:58 am
by Commander_X
<tosses 0.02 credits on the table>
Did anybody look into localization/OS kicking in? I.e. Oolite runs (say) English US, but OS is set to English UK? ... Shortcuts to switch keyboards and the such (maybe Alt/AltGr involved)?
... just saying!
Re: left and right bug
Posted: Tue Oct 12, 2021 2:46 am
by phkb
In my tests, I can confirm the issue only seems to occur if you alt-tab to a window on the same screen as Oolite, regardless of the maximised state of that window or Oolite. If I alt-tab to a window on another monitor, then alt-tab back to Oolite, the issue doesn't occur. Also, it only appears to impact the left/right arrow keys, not the up/down arrow keys.