The keys ctrl+M not works in Simutrans.
In other windows programms ( Total Commander, Opera ) works keys ctrl+M.
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.
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.. :)
In trunk, seems to work as intended.
r2640
ctrl + M and ctrl + H working
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.
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.