The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Frank on August 15, 2009, 06:44:10 pm

Title: r2611 - keys ctrl+M
Post by: Frank on August 15, 2009, 06:44:10 pm
The keys ctrl+M not works in Simutrans.

In other windows programms ( Total Commander, Opera ) works keys ctrl+M.
Title: Re: r2611 - keys ctrl+M
Post by: Dwachs on August 16, 2009, 10:01:23 am
Currently (under Windows - cant test on linux now) ctrl-M and enter are treated as if they were the same keys. The same goes for ctrl-H and backspace.

Here is a patch that works under windows. Would somebody please test under linux? The point is that currently one cannot ****ociate ctrl-M and ctrl-H to tools in menuconf.tab.

Ctrl-V will not work either, it is used for pasting.
Title: Re: r2611 - keys ctrl+M
Post by: gerw on August 16, 2009, 03:39:10 pm
When I pressed Ctrl (and no other key), Simutrans raised a "keycode 0, keymode 2"-event. Thus, keycode 0 should be always ignored. Does this also happend in Windows?

I also I added some comments. And please read documentation/coding_styles.txt  ;) ;D  - I've felt like needing more smileys.. :)
Title: Re: r2611 - keys ctrl+M
Post by: prissi on September 05, 2009, 08:33:00 pm
In trunk, seems to work as intended.
Title: Re: r2611 - keys ctrl+M
Post by: Frank on September 08, 2009, 02:27:37 pm
r2640

ctrl + M and ctrl + H working
Title: Re: r2611 - keys ctrl+M
Post by: z9999 on September 08, 2009, 02:39:59 pm
If text input area is focused, ctrl+M acts as retuen key AND acts as short cut key.
Is this intended ? I tested both GDI and SDL.
Title: Re: r2611 - keys ctrl+M
Post by: Dwachs on September 08, 2009, 06:17:43 pm
This has two reasons: (1) in textinput Ctrl+M and Enter are treated as the same keys, (2) if keyboard event releases focus, this event is p****ed to the main event handler.

That means, Ctrl+M releases focus in textinput, but will be p****ed to the main event handler, which calles the tool that is mapped to Ctrl+M. The same happens for Enter, but tools cannot be mapped to this key.

Here is a patch. It fixes this bug, but introduces another one: pressing Esc in text-input will now only release focus but does not close the window immediately.

Another way would be to directly patch textinput. But then Ctrl+Enter won't work like Enter.

The main difficulty is to distinguish Enter, Ctrl+M, and Ctrl+Enter.