Login  Register

Re: Customize shortcut/hotkeys

Posted by LordOfBikes on May 23, 2020; 1:12pm
URL: https://forum.librecad.org/Customize-shortcut-hotkeys-tp5718912p5718968.html

I got your point.
Don't nail me down on following statements, all from top off my head, no time to check the code myself yet.
I think the alias file isn't deployed, it's generated from these codes in rs_command.cpp on startup.
It may be also needed for the clear settings feature in application preferences.
At least, the commands and aliases are extracted by translation tools for localization.
And yes, Keycode mode is also involved there.

This initialization in rs_command.cpp can be very irritating because of all the curly braces.
Basically each mapping contains 3 elements, a list of command words, a list of aliases and the ActionType enum.
Each command or alias itself is a pair of strings, where the first string is the base and the second string is the localized version. The second string inside QObject::tr() is only a comment shown to the translator.
For example find "draw parallel line", it has 2 commands and 2 aliases. Or "draw rectangle" which has only one command but 3 aliases.
But most commands have only one command and one alias.

Also I don't want to exclude, that there are some inconsistencies, where different commands have the same aliases. I think I remember this from my earlier translation tasks.
This is another issue, but I think it's worth to investigate.
investing less than half an hour into Search function can save hours or days of waiting for a solution