News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

[r12321] Most keyboard keys not working

Started by hymie, Yesterday at 04:56:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hymie

I just downloaded Simutrans 1.25 r12321 for Linux.  I find that most of my keys are no longer working.  I can use control-keys (for example, control-u still shows the sliced underground mode) but regular keys (such as p for pause) and shifted keys (such as shift-w for fast-forward) are not having any obvious effect.  This happens with both pak128 and pak128.german .

I can switch back and forth between 1.24.5 r 11993 (which works correctly) and 1.25 r 12321 (which does not work).


Nazalassa

I can confirm this happens on Linux with the SDL2 backend.

Patch: http://patches.simutrans-germany.com/download.php?file=fix-keys-2.patch

This behaviour appears in r12277, "(hopefully) show soft keyboard on Android". This is the culprit:
Code (C++) Select
gui_textinput_t::~gui_textinput_t()
{
   // does not hurt to close the screen window again to be sure ...             
   dr_stop_textinput();                                                       
}

The attached patch modifies dr_stop_textinput() in the SDL2 backend so that it does not disable textinput unless env_t::hide_keyboard is set.

The SDL3 backend already does the check and so does not need any changes.
Making paks since October 2023  |  pak48.bitlit | pak32.box | MLM for pak64 | Empire F7 cars | Pneumatic tubes | More pak64 vehicles and industries

Life is like a multi-tasking OS: you know you'll eventually get back to everything, but you don't know when.

victor_18993

Thanks, Nazalassa. I reproduced the issue and confirmed that it started in r12277.

Your patch fixes it and has now been integrated in trunk as r12326. I also checked that text editing, Android input and the hide_keyboard option still behave correctly.

So this should be fixed in current nightlies. Thanks for finding it and providing the patch!
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)