Can I ask how exactly you checked it? There are several commits in the request, in one of them I make this method a class method.
I applied these changes manually, in the sources of a normal Lazaurs installation (I don't use Git or trunk). If your fixes work for you, it means I forgot something, so it's my fault. I'll try again when I have some free time, this time I'll do it more carefully, so there's no misunderstanding.
[Win+Left/Right] is used by the Windows to pin a window to half of the screen (try it on some regular window), and with [Shift] - to move a window between monitors. The OS will not allow any application to use these combinations.
However, both of these shortcuts do nothing on my computer (Win10, two monitors), so I wrongly assumed the system was not using them at all (so they are free). Again, my fault.
It is precisely about such restrictions that the checkbox should warn you ))
Indeed. It's a pity that trying to capture a shortcut reserved by the system does not provide any feedback from Lazarus, so you never know why such a shortcut cannot be used. This is where it gets a bit complicated, because since the IDE does not receive messages about the shortcut being executed, there is no way to inform the user that the executed shortcut is reserved.
To solve this and inform the user about which keyboard shortcuts are reserved, it would be good to
check their list in Microsoft's documentation and provide access to this information in the IDE interface (maybe a button or link that opens documentation with a list of shortcuts and information about what the system uses them for), so that the user can familiarize themselves with this information. You can also add such link in the
Grab key window.
You would have to think about how to do it properly, i.e. on the one hand, it would be possible to assign shortcuts with the
Meta key, and on the other hand, so that the user has access to information about which shortcuts are reserved by the OS (i.e. so that he does not have a grudge against the IDE developers that something does not work and does not consider it a bug).
I hope that you will still be able to find a sufficient number of free combinations for the actions you often use.
There are a lot of free shortcuts with the
Win key — for example, I can use the
Win+Alt+Left/Right shortcut to switch between editor tabs and the
Win+Alt+Up/Down shortcut to switch between code editor windows. The system does not use shortcuts with the
Win+Alt+<key> keys, so this should not be a problem.
And that is why I personally think the Win-Key should not be an (advertised) feature in the Keymap.
Just because something is difficult or troublesome doesn't mean you should give up. Especially since you've made an entire IDE and adapted it to various systems, which required a lot of work and dealing with system-specific things.
If there is some warning, it will just lead to "Why did the makers of Lazarus disable that combo?". Yes, even if it says "It's Windows doing the restriction". It's a very human feature to ignore inconvenient info...
It will always be like this and there is nothing you can do about it, because if someone really doesn't want to acknowledge something, they won't. If you take care of supporting shortcuts with the
Meta key, just describe their use and adapt the IDE interface to capture them, then you will do everything that needs to be done.
So if someone reads the documentation and sees in the IDE that a given shortcut cannot be used because the IDE doesn't even receive data about its pressing, but still doesn't acknowledge it and has complaints, well — you can't conclude anything more than that such a user is simply an idiot and you can do nothing with it. This applies to all IDE features, not just the shortcut capturing discussed here.