problem with CTRL key in two-key shortcut
Original Reporter info from Mantis: mark.bravington@csiro.au
-
Reporter name:
Original Reporter info from Mantis: mark.bravington@csiro.au
- Reporter name:
Description:
With two-key shortcuts where the first key needs CTRL, Lazarus also checks the status of CTRL on the 2nd key. So it treats eg CTRL-Q S differently from CTRL-Q CTRL-S. But the user might well type either, and expect them to do the same thing, which is standard in some other software. Such shortcuts are common in eg Classic keymap scheme.
The problem with using two shortcuts, one for CTRL-Q CTRL-S and one for CTRL-Q S, is that only max two shortcuts are allowed, so this leaves no room to bind eg HOME to the same action. (This has been reported long ago, but I couldn't find it today.)
For several years, I've been manually tweaking each new Lazarus release to do this, in syneditkeycmds.pp (also the consistency check in keymapping.pp). I actually couldn't bear to use Lazarus without this tweak. Now I have finally downloaded Git and tried to develop a proper patch-- attached. Hope it's OK-- my first try with Git or SVN...
NB I don't think there would be any bad side-effect, but one hyper-cautious option could be to add a checkbox in Tools/Options/Editor/Keymap for "ignore 2nd CTRL key in two-key shortcuts where first key requires CTRL" (or something a bit shorter), with default FALSE for back-compatibility. I think my patch has comments where the additional "AND" would need to go in such cases.